summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-04-24 21:21:05 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-04-27 01:15:22 -0400
commitd416f352ada56a65107ff4b47e8e3161bbf26899 (patch)
tree7bbac2d5b33b519287601806a37a2dc0dd71cec7 /testsuite
parent5e7fd924c4542a60d078dd8f267b4182fb55b748 (diff)
downloadgtk+-d416f352ada56a65107ff4b47e8e3161bbf26899.tar.gz
Add tests for the GtkCellLayout builder parser
These tests check various error conditions in GtkCellLayout custom tags.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gtk/Makefile.am7
-rw-r--r--testsuite/gtk/ui/celllayout1.expected1
-rw-r--r--testsuite/gtk/ui/celllayout1.ui16
-rw-r--r--testsuite/gtk/ui/celllayout2.expected2
-rw-r--r--testsuite/gtk/ui/celllayout2.ui12
-rw-r--r--testsuite/gtk/ui/celllayout3.expected2
-rw-r--r--testsuite/gtk/ui/celllayout3.ui12
-rw-r--r--testsuite/gtk/ui/celllayout4.expected2
-rw-r--r--testsuite/gtk/ui/celllayout4.ui12
-rw-r--r--testsuite/gtk/ui/celllayout5.expected2
-rw-r--r--testsuite/gtk/ui/celllayout5.ui12
-rw-r--r--testsuite/gtk/ui/celllayout6.expected2
-rw-r--r--testsuite/gtk/ui/celllayout6.ui12
-rw-r--r--testsuite/gtk/ui/celllayout7.expected2
-rw-r--r--testsuite/gtk/ui/celllayout7.ui12
15 files changed, 108 insertions, 0 deletions
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 7d71625cda..071535b8db 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -178,6 +178,13 @@ test_ui = \
ui/label3.ui ui/label3.expected \
ui/label4.ui ui/label4.expected \
ui/label5.ui ui/label5.expected \
+ ui/celllayout1.ui ui/celllayout1.expected \
+ ui/celllayout2.ui ui/celllayout2.expected \
+ ui/celllayout3.ui ui/celllayout3.expected \
+ ui/celllayout4.ui ui/celllayout4.expected \
+ ui/celllayout5.ui ui/celllayout5.expected \
+ ui/celllayout6.ui ui/celllayout6.expected \
+ ui/celllayout7.ui ui/celllayout7.expected \
$(NULL)
EXTRA_DIST += \
diff --git a/testsuite/gtk/ui/celllayout1.expected b/testsuite/gtk/ui/celllayout1.expected
new file mode 100644
index 0000000000..ff43ca4091
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout1.expected
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/celllayout1.ui b/testsuite/gtk/ui/celllayout1.ui
new file mode 100644
index 0000000000..9b91d53fbb
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout1.ui
@@ -0,0 +1,16 @@
+<!-- test valid cell layout custom tags -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ <cell-packing>
+ <property name="align" translatable="yes" comments="foo" context="bar">True</property>
+ <property name="expand">False</property>
+ </cell-packing>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout2.expected b/testsuite/gtk/ui/celllayout2.expected
new file mode 100644
index 0000000000..42b92c42c6
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout2.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:9:1 Could not parse integer `blue'
diff --git a/testsuite/gtk/ui/celllayout2.ui b/testsuite/gtk/ui/celllayout2.ui
new file mode 100644
index 0000000000..44644bf11b
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout2.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout attribute value -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ <attribute name="text">blue</attribute>
+ </attributes>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout3.expected b/testsuite/gtk/ui/celllayout3.expected
new file mode 100644
index 0000000000..0fbace7348
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout3.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:8:45 attribute 'food' invalid for element 'attribute'
diff --git a/testsuite/gtk/ui/celllayout3.ui b/testsuite/gtk/ui/celllayout3.ui
new file mode 100644
index 0000000000..43d9f96e7c
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout3.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout attribute name -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ <attribute name="text" food="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout4.expected b/testsuite/gtk/ui/celllayout4.expected
new file mode 100644
index 0000000000..b40ff5ba80
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout4.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:8:17 Unsupported tag for GtkCellLayout: <warbl>
diff --git a/testsuite/gtk/ui/celllayout4.ui b/testsuite/gtk/ui/celllayout4.ui
new file mode 100644
index 0000000000..7e574500e3
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout4.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout attribute -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ <warbl/>
+ </attributes>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout5.expected b/testsuite/gtk/ui/celllayout5.expected
new file mode 100644
index 0000000000..027a052673
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout5.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+Unhandled tag: <warbl>
diff --git a/testsuite/gtk/ui/celllayout5.ui b/testsuite/gtk/ui/celllayout5.ui
new file mode 100644
index 0000000000..244b998655
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout5.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout attribute -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <attributes>
+ </attributes>
+ <warbl/>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout6.expected b/testsuite/gtk/ui/celllayout6.expected
new file mode 100644
index 0000000000..524adddd41
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout6.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:8:44 attribute 'food' invalid for element 'property'
diff --git a/testsuite/gtk/ui/celllayout6.ui b/testsuite/gtk/ui/celllayout6.ui
new file mode 100644
index 0000000000..46d29e6ae9
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout6.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout custom attribute value -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <cell-packing>
+ <property name="name" food="food">1</property>
+ </cell-packing>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/celllayout7.expected b/testsuite/gtk/ui/celllayout7.expected
new file mode 100644
index 0000000000..b40ff5ba80
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout7.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:8:17 Unsupported tag for GtkCellLayout: <warbl>
diff --git a/testsuite/gtk/ui/celllayout7.ui b/testsuite/gtk/ui/celllayout7.ui
new file mode 100644
index 0000000000..91092f429a
--- /dev/null
+++ b/testsuite/gtk/ui/celllayout7.ui
@@ -0,0 +1,12 @@
+<!-- test invalid cell layout custom element -->
+<interface>
+ <object class="GtkIconView">
+ <child>
+ <object class="GtkCellRendererText">
+ </object>
+ <cell-packing>
+ <warbl/>
+ </cell-packing>
+ </child>
+ </object>
+</interface>