[gtk+] Add tests for GtkContainer builder parser



commit 66ce0b6509d9a2c413174921d49cedb263e5b54f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 25 23:58:08 2015 -0400

    Add tests for GtkContainer builder parser

 testsuite/gtk/ui/container1.expected |    1 +
 testsuite/gtk/ui/container1.ui       |   14 ++++++++++++++
 testsuite/gtk/ui/container2.expected |    2 ++
 testsuite/gtk/ui/container2.ui       |   11 +++++++++++
 testsuite/gtk/ui/container3.expected |    2 ++
 testsuite/gtk/ui/container3.ui       |   11 +++++++++++
 testsuite/gtk/ui/container4.expected |    2 ++
 testsuite/gtk/ui/container4.ui       |    8 ++++++++
 testsuite/gtk/ui/container5.expected |    2 ++
 testsuite/gtk/ui/container5.ui       |    8 ++++++++
 testsuite/gtk/ui/container6.expected |    2 ++
 testsuite/gtk/ui/container6.ui       |    8 ++++++++
 testsuite/gtk/ui/container7.expected |    2 ++
 testsuite/gtk/ui/container7.ui       |   10 ++++++++++
 14 files changed, 83 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/ui/container1.expected b/testsuite/gtk/ui/container1.expected
new file mode 100644
index 0000000..ff43ca4
--- /dev/null
+++ b/testsuite/gtk/ui/container1.expected
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/container1.ui b/testsuite/gtk/ui/container1.ui
new file mode 100644
index 0000000..e0101e7
--- /dev/null
+++ b/testsuite/gtk/ui/container1.ui
@@ -0,0 +1,14 @@
+<!-- test all valid container attributes -->
+<interface>
+  <object class="GtkBox">
+    <child>
+      <object class="GtkLabel" id="widget1"/>
+      <packing>
+        <property name="expand" translatable="yes" comments="foo" context="bar">True</property>
+      </packing>
+    </child>
+    <focus-chain>
+      <widget name="widget1"/>
+    </focus-chain>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container2.expected b/testsuite/gtk/ui/container2.expected
new file mode 100644
index 0000000..f1350c8
--- /dev/null
+++ b/testsuite/gtk/ui/container2.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 6
+.:7:32 element 'property' requires attribute 'name'
diff --git a/testsuite/gtk/ui/container2.ui b/testsuite/gtk/ui/container2.ui
new file mode 100644
index 0000000..81a41a6
--- /dev/null
+++ b/testsuite/gtk/ui/container2.ui
@@ -0,0 +1,11 @@
+<!-- invalid child property attribute -->
+<interface>
+  <object class="GtkBox">
+    <child>
+      <object class="GtkLabel" id="widget1"/>
+      <packing>
+        <property food="good"/>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container3.expected b/testsuite/gtk/ui/container3.expected
new file mode 100644
index 0000000..0ac1da5
--- /dev/null
+++ b/testsuite/gtk/ui/container3.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:7:17 Unsupported tag for GtkContainer: <warbl>
diff --git a/testsuite/gtk/ui/container3.ui b/testsuite/gtk/ui/container3.ui
new file mode 100644
index 0000000..04d35bf
--- /dev/null
+++ b/testsuite/gtk/ui/container3.ui
@@ -0,0 +1,11 @@
+<!-- invalid packing element -->
+<interface>
+  <object class="GtkBox">
+    <child>
+      <object class="GtkLabel" id="widget1"/>
+      <packing>
+        <warbl/>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container4.expected b/testsuite/gtk/ui/container4.expected
new file mode 100644
index 0000000..073d5bd
--- /dev/null
+++ b/testsuite/gtk/ui/container4.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 6
+.:5:16 element 'widget' requires attribute 'name'
diff --git a/testsuite/gtk/ui/container4.ui b/testsuite/gtk/ui/container4.ui
new file mode 100644
index 0000000..97c46c9
--- /dev/null
+++ b/testsuite/gtk/ui/container4.ui
@@ -0,0 +1,8 @@
+<!-- missing focus chain widget name attribute -->
+<interface>
+  <object class="GtkBox">
+    <focus-chain>
+      <widget/>
+    </focus-chain>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container5.expected b/testsuite/gtk/ui/container5.expected
new file mode 100644
index 0000000..15d5a36
--- /dev/null
+++ b/testsuite/gtk/ui/container5.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 6
+.:5:28 element 'widget' requires attribute 'name'
diff --git a/testsuite/gtk/ui/container5.ui b/testsuite/gtk/ui/container5.ui
new file mode 100644
index 0000000..2857c68
--- /dev/null
+++ b/testsuite/gtk/ui/container5.ui
@@ -0,0 +1,8 @@
+<!-- wrong focus chain widget name attribute -->
+<interface>
+  <object class="GtkBox">
+    <focus-chain>
+      <widget food="good"/>
+    </focus-chain>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container6.expected b/testsuite/gtk/ui/container6.expected
new file mode 100644
index 0000000..1cb8b4f
--- /dev/null
+++ b/testsuite/gtk/ui/container6.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:5:15 Unsupported tag for GtkContainer: <warbl>
diff --git a/testsuite/gtk/ui/container6.ui b/testsuite/gtk/ui/container6.ui
new file mode 100644
index 0000000..3797adc
--- /dev/null
+++ b/testsuite/gtk/ui/container6.ui
@@ -0,0 +1,8 @@
+<!-- wrong focus chain element -->
+<interface>
+  <object class="GtkBox">
+    <focus-chain>
+      <warbl/>
+    </focus-chain>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/container7.expected b/testsuite/gtk/ui/container7.expected
new file mode 100644
index 0000000..8288126
--- /dev/null
+++ b/testsuite/gtk/ui/container7.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:7:1 attribute 'try' invalid for element 'packing'
diff --git a/testsuite/gtk/ui/container7.ui b/testsuite/gtk/ui/container7.ui
new file mode 100644
index 0000000..436e4a6
--- /dev/null
+++ b/testsuite/gtk/ui/container7.ui
@@ -0,0 +1,10 @@
+<!-- invalid container packing attribute -->
+<interface>
+  <object class="GtkBox">
+    <child>
+      <object class="GtkLabel" id="widget1"/>
+      <packing try="this">
+      </packing>
+    </child>
+  </object>
+</interface>


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