[gtk/matthiasc/for-master: 4/4] testsuite: Add a test for transforms in builder files



commit aecea431604ca7a3e8784a36d7482f4092dba947
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 31 15:59:23 2020 -0400

    testsuite: Add a test for transforms in builder files

 testsuite/gtk/builder.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
---
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index a13fc68d28..1a35919a79 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -2454,6 +2454,45 @@ test_shortcuts (void)
   g_object_unref (builder);
 }
 
+static void
+test_transforms (void)
+{
+  GtkBuilder * builder;
+  const gchar buffer1[] =
+    "<interface>"
+    "  <object class=\"GtkFixed\" id=\"fixed1\">"
+    "    <child>"
+    "      <object class=\"GtkLabel\" id=\"label1\">"
+    "        <layout>"
+    "          <property name=\"transform\">rotateX(45.0)</property>"
+    "        </layout>"
+    "      </object>"
+    "    </child>"
+    "    <child>"
+    "      <object class=\"GtkLabel\" id=\"label2\">"
+    "        <layout>"
+    "          <property name=\"transform\">scale3d(1,2,3)translate3d(2,3,0)</property>"
+    "        </layout>"
+    "      </object>"
+    "    </child>"
+    "  </object>"
+    "</interface>";
+
+  GObject *label, *vbox;
+
+  builder = builder_new_from_string (buffer1, -1, NULL);
+  vbox = gtk_builder_get_object (builder, "fixed1");
+  g_assert (GTK_IS_FIXED (vbox));
+
+  label = gtk_builder_get_object (builder, "label1");
+  g_assert (GTK_IS_LABEL (label));
+
+  label = gtk_builder_get_object (builder, "label2");
+  g_assert (GTK_IS_LABEL (label));
+
+  g_object_unref (builder);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -2499,6 +2538,7 @@ main (int argc, char **argv)
   g_test_add_func ("/Builder/anaconda-signal", test_anaconda_signal);
   g_test_add_func ("/Builder/FileFilter", test_file_filter);
   g_test_add_func ("/Builder/Shortcuts", test_shortcuts);
+  g_test_add_func ("/Builder/Transforms", test_transforms);
 
   return g_test_run();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]