Commit e973d49a authored by Matthias Clasen's avatar Matthias Clasen

Add tests for the GtkScale builder parser

These tests check various error conditions in GtkScale
custom tags.
parent 374f9662
......@@ -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 += \
......
<!-- 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>
ERROR: g-markup-error-quark 4
.:5:43 attribute 'nosuchattribute' invalid for element 'mark'
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark nosuchattribute="" value="0"/>
</marks>
</object>
</interface>
ERROR: g-markup-error-quark 5
.:5:46 element 'mark', attribute 'translatable', value 'foobar' cannot be parsed as a boolean value
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark translatable="foobar" value="0"/>
</marks>
</object>
</interface>
ERROR: gtk-builder-error-quark 6
.:5:43 Could not parse enum: `between'
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark value="0" position="between"/>
</marks>
</object>
</interface>
ERROR: gtk-builder-error-quark 6
.:5:26 Could not parse double `abc'
<!-- test invalid scale mark attributes -->
<interface>
<object class="GtkScale">
<marks>
<mark value="abc"/>
</marks>
</object>
</interface>
ERROR: gtk-builder-error-quark 1
.:5:13 Unsupported tag for GtkScale: <foo>
<!-- test invalid scale mark element -->
<interface>
<object class="GtkScale">
<marks>
<foo/>
</marks>
</object>
</interface>
ERROR: gtk-builder-error-quark 1
Unhandled tag: <foo>
<!-- test invalid scale subelement -->
<interface>
<object class="GtkScale">
<marks>
</marks>
<foo/>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment