[gtk+] Add tests for the infobar builder parser
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add tests for the infobar builder parser
- Date: Mon, 27 Apr 2015 05:19:21 +0000 (UTC)
commit 8ae4a82ae41efc8b0f564586e8ddf9d1a7f03a52
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 26 23:03:05 2015 -0400
Add tests for the infobar builder parser
testsuite/gtk/Makefile.am | 5 +++++
testsuite/gtk/ui/infobar1.expected | 1 +
testsuite/gtk/ui/infobar1.ui | 17 +++++++++++++++++
testsuite/gtk/ui/infobar2.expected | 2 ++
testsuite/gtk/ui/infobar2.ui | 11 +++++++++++
testsuite/gtk/ui/infobar3.expected | 2 ++
testsuite/gtk/ui/infobar3.ui | 11 +++++++++++
testsuite/gtk/ui/infobar4.expected | 2 ++
testsuite/gtk/ui/infobar4.ui | 11 +++++++++++
testsuite/gtk/ui/infobar5.expected | 2 ++
testsuite/gtk/ui/infobar5.ui | 11 +++++++++++
11 files changed, 75 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 5d52a50..1141ccf 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -214,6 +214,11 @@ test_ui = \
ui/filefilter8.ui ui/filefilter8.expected \
ui/filefilter9.ui ui/filefilter9.expected \
ui/filefilter10.ui ui/filefilter10.expected \
+ ui/infobar1.ui ui/infobar1.expected \
+ ui/infobar2.ui ui/infobar2.expected \
+ ui/infobar3.ui ui/infobar3.expected \
+ ui/infobar4.ui ui/infobar4.expected \
+ ui/infobar5.ui ui/infobar5.expected \
$(NULL)
EXTRA_DIST += \
diff --git a/testsuite/gtk/ui/infobar1.expected b/testsuite/gtk/ui/infobar1.expected
new file mode 100644
index 0000000..ff43ca4
--- /dev/null
+++ b/testsuite/gtk/ui/infobar1.expected
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/infobar1.ui b/testsuite/gtk/ui/infobar1.ui
new file mode 100644
index 0000000..26d667f
--- /dev/null
+++ b/testsuite/gtk/ui/infobar1.ui
@@ -0,0 +1,17 @@
+<!-- test all valid infobar markup -->
+<interface>
+ <object class="GtkInfoBar">
+ <child>
+ <object class="GtkButton" id="button_cancel"/>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_ok">
+ <property name="can-default">True</property>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-3">button_cancel</action-widget>
+ <action-widget response="ok">button_ok</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar2.expected b/testsuite/gtk/ui/infobar2.expected
new file mode 100644
index 0000000..ff66960
--- /dev/null
+++ b/testsuite/gtk/ui/infobar2.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:8:38 Could not parse enum: `xyz'
diff --git a/testsuite/gtk/ui/infobar2.ui b/testsuite/gtk/ui/infobar2.ui
new file mode 100644
index 0000000..7379a68
--- /dev/null
+++ b/testsuite/gtk/ui/infobar2.ui
@@ -0,0 +1,11 @@
+<!-- invalid response value -->
+<interface>
+ <object class="GtkInfoBar">
+ <child>
+ <object class="GtkButton" id="button_cancel"/>
+ </child>
+ <action-widgets>
+ <action-widget response="xyz">button_cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar3.expected b/testsuite/gtk/ui/infobar3.expected
new file mode 100644
index 0000000..d40e631
--- /dev/null
+++ b/testsuite/gtk/ui/infobar3.expected
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:8:48 attribute 'food' invalid for element 'action-widget'
diff --git a/testsuite/gtk/ui/infobar3.ui b/testsuite/gtk/ui/infobar3.ui
new file mode 100644
index 0000000..a469d76
--- /dev/null
+++ b/testsuite/gtk/ui/infobar3.ui
@@ -0,0 +1,11 @@
+<!-- invalid attribute -->
+<interface>
+ <object class="GtkInfoBar">
+ <child>
+ <object class="GtkButton" id="button_cancel"/>
+ </child>
+ <action-widgets>
+ <action-widget response="ok" food="egg">button_cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar4.expected b/testsuite/gtk/ui/infobar4.expected
new file mode 100644
index 0000000..f4e1d2b
--- /dev/null
+++ b/testsuite/gtk/ui/infobar4.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:8:15 Unsupported tag for GtkInfoBar: <worbl>
diff --git a/testsuite/gtk/ui/infobar4.ui b/testsuite/gtk/ui/infobar4.ui
new file mode 100644
index 0000000..0730d5b
--- /dev/null
+++ b/testsuite/gtk/ui/infobar4.ui
@@ -0,0 +1,11 @@
+<!-- invalid element -->
+<interface>
+ <object class="GtkInfoBar">
+ <child>
+ <object class="GtkButton" id="button_cancel"/>
+ </child>
+ <action-widgets>
+ <worbl/>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/testsuite/gtk/ui/infobar5.expected b/testsuite/gtk/ui/infobar5.expected
new file mode 100644
index 0000000..65dee44
--- /dev/null
+++ b/testsuite/gtk/ui/infobar5.expected
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+Unhandled tag: <worbl>
diff --git a/testsuite/gtk/ui/infobar5.ui b/testsuite/gtk/ui/infobar5.ui
new file mode 100644
index 0000000..01bdcbb
--- /dev/null
+++ b/testsuite/gtk/ui/infobar5.ui
@@ -0,0 +1,11 @@
+<!-- invalid element -->
+<interface>
+ <object class="GtkInfoBar">
+ <child>
+ <object class="GtkButton" id="button_cancel"/>
+ </child>
+ <action-widgets>
+ </action-widgets>
+ <worbl/>
+ </object>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]