Add tests for the GtkDialog builder parser

This commit is contained in:
Matthias Clasen 2015-04-26 15:03:03 -04:00
parent 4ee291c8f1
commit 95ea81d6d1
11 changed files with 84 additions and 0 deletions

View File

@ -198,6 +198,12 @@ test_ui = \
ui/levelbar4.ui ui/levelbar4.expected \
ui/levelbar5.ui ui/levelbar5.expected \
ui/levelbar6.ui ui/levelbar6.expected \
ui/dialog1.ui ui/dialog1.expected \
ui/dialog2.ui ui/dialog2.expected \
ui/dialog3.ui ui/dialog3.expected \
ui/dialog4.ui ui/dialog4.expected \
ui/dialog5.ui ui/dialog5.expected \
ui/dialog6.ui ui/dialog6.expected \
$(NULL)
EXTRA_DIST += \

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,17 @@
<!-- test all valid dialog markup -->
<interface>
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="button_cancel"/>
</child>
<child type="action">
<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" default="true">button_ok</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 6
.:10:23 element 'action-widget' requires attribute 'response'

View File

@ -0,0 +1,13 @@
<!-- missing attribute in dialog markup -->
<interface>
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="button_ok">
<property name="can-default">True</property>
</object>
</child>
<action-widgets>
<action-widget>button_ok</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
.:10:40 Could not parse enum: `warbl'

View File

@ -0,0 +1,13 @@
<!-- invalid dialog markup attribute -->
<interface>
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="button_ok">
<property name="can-default">True</property>
</object>
</child>
<action-widgets>
<action-widget response="warbl">button_ok</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
.:10:15 Unsupported tag for GtkDialog: <warbl>

View File

@ -0,0 +1,13 @@
<!-- invalid dialog markup element -->
<interface>
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="button_ok">
<property name="can-default">True</property>
</object>
</child>
<action-widgets>
<warbl/>
</action-widgets>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
Unhandled tag: <warbl>

View File

@ -0,0 +1,13 @@
<!-- invalid dialog markup element -->
<interface>
<object class="GtkDialog">
<child type="action">
<object class="GtkButton" id="button_ok">
<property name="can-default">True</property>
</object>
</child>
<action-widgets>
</action-widgets>
<warbl/>
</object>
</interface>