Add tests for the GtkScale builder parser

These tests check various error conditions in GtkScale
custom tags.
This commit is contained in:
Matthias Clasen 2015-04-25 11:24:40 -04:00
parent 374f96625f
commit e973d49a11
15 changed files with 77 additions and 0 deletions

View File

@ -185,6 +185,13 @@ test_ui = \
ui/celllayout5.ui ui/celllayout5.expected \
ui/celllayout6.ui ui/celllayout6.expected \
ui/celllayout7.ui ui/celllayout7.expected \
ui/scale1.ui ui/scale1.expected \
ui/scale2.ui ui/scale2.expected \
ui/scale3.ui ui/scale3.expected \
ui/scale4.ui ui/scale4.expected \
ui/scale5.ui ui/scale5.expected \
ui/scale6.ui ui/scale6.expected \
ui/scale7.ui ui/scale7.expected \
$(NULL)
EXTRA_DIST += \

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,9 @@
<!-- test valid scale custom tags -->
<interface>
<object class="GtkScale">
<marks>
<mark translatable="yes" comments="blargh" context="none" value="0.1" position="top">text</mark>
<mark value="0.9"/>
</marks>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 4
.:5:43 attribute 'nosuchattribute' invalid for element 'mark'

View File

@ -0,0 +1,8 @@
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark nosuchattribute="" value="0"/>
</marks>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 5
.:5:46 element 'mark', attribute 'translatable', value 'foobar' cannot be parsed as a boolean value

View File

@ -0,0 +1,8 @@
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark translatable="foobar" value="0"/>
</marks>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
.:5:43 Could not parse enum: `between'

View File

@ -0,0 +1,8 @@
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark value="0" position="between"/>
</marks>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 6
.:5:26 Could not parse double `abc'

View File

@ -0,0 +1,8 @@
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark value="abc"/>
</marks>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
.:5:13 Unsupported tag for GtkScale: <foo>

View File

@ -0,0 +1,8 @@
<!-- test invalid scale mark element -->
<interface>
<object class="GtkScale">
<marks>
<foo/>
</marks>
</object>
</interface>

View File

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

View File

@ -0,0 +1,8 @@
<!-- test invalid scale subelement -->
<interface>
<object class="GtkScale">
<marks>
</marks>
<foo/>
</object>
</interface>