forked from AuroraMiddleware/gtk
Add tests for the GtkScale builder parser
These tests check various error conditions in GtkScale custom tags.
This commit is contained in:
parent
374f96625f
commit
e973d49a11
@ -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 += \
|
||||
|
1
testsuite/gtk/ui/scale1.expected
Normal file
1
testsuite/gtk/ui/scale1.expected
Normal file
@ -0,0 +1 @@
|
||||
SUCCESS
|
9
testsuite/gtk/ui/scale1.ui
Normal file
9
testsuite/gtk/ui/scale1.ui
Normal 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>
|
2
testsuite/gtk/ui/scale2.expected
Normal file
2
testsuite/gtk/ui/scale2.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: g-markup-error-quark 4
|
||||
.:5:43 attribute 'nosuchattribute' invalid for element 'mark'
|
8
testsuite/gtk/ui/scale2.ui
Normal file
8
testsuite/gtk/ui/scale2.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale mark attributes -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
<mark nosuchattribute="" value="0"/>
|
||||
</marks>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/scale3.expected
Normal file
2
testsuite/gtk/ui/scale3.expected
Normal 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
|
8
testsuite/gtk/ui/scale3.ui
Normal file
8
testsuite/gtk/ui/scale3.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale mark attributes -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
<mark translatable="foobar" value="0"/>
|
||||
</marks>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/scale4.expected
Normal file
2
testsuite/gtk/ui/scale4.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 6
|
||||
.:5:43 Could not parse enum: `between'
|
8
testsuite/gtk/ui/scale4.ui
Normal file
8
testsuite/gtk/ui/scale4.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale mark attributes -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
<mark value="0" position="between"/>
|
||||
</marks>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/scale5.expected
Normal file
2
testsuite/gtk/ui/scale5.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 6
|
||||
.:5:26 Could not parse double `abc'
|
8
testsuite/gtk/ui/scale5.ui
Normal file
8
testsuite/gtk/ui/scale5.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale mark attributes -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
<mark value="abc"/>
|
||||
</marks>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/scale6.expected
Normal file
2
testsuite/gtk/ui/scale6.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 1
|
||||
.:5:13 Unsupported tag for GtkScale: <foo>
|
8
testsuite/gtk/ui/scale6.ui
Normal file
8
testsuite/gtk/ui/scale6.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale mark element -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
<foo/>
|
||||
</marks>
|
||||
</object>
|
||||
</interface>
|
2
testsuite/gtk/ui/scale7.expected
Normal file
2
testsuite/gtk/ui/scale7.expected
Normal file
@ -0,0 +1,2 @@
|
||||
ERROR: gtk-builder-error-quark 1
|
||||
Unhandled tag: <foo>
|
8
testsuite/gtk/ui/scale7.ui
Normal file
8
testsuite/gtk/ui/scale7.ui
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- test invalid scale subelement -->
|
||||
<interface>
|
||||
<object class="GtkScale">
|
||||
<marks>
|
||||
</marks>
|
||||
<foo/>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user