Add tests for GtkContainer builder parser

This commit is contained in:
Matthias Clasen 2015-04-25 23:58:08 -04:00
parent aeddf55655
commit 66ce0b6509
14 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1 @@
SUCCESS

View File

@ -0,0 +1,14 @@
<!-- test all valid container attributes -->
<interface>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="widget1"/>
<packing>
<property name="expand" translatable="yes" comments="foo" context="bar">True</property>
</packing>
</child>
<focus-chain>
<widget name="widget1"/>
</focus-chain>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 6
.:7:32 element 'property' requires attribute 'name'

View File

@ -0,0 +1,11 @@
<!-- invalid child property attribute -->
<interface>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="widget1"/>
<packing>
<property food="good"/>
</packing>
</child>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: gtk-builder-error-quark 1
.:7:17 Unsupported tag for GtkContainer: <warbl>

View File

@ -0,0 +1,11 @@
<!-- invalid packing element -->
<interface>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="widget1"/>
<packing>
<warbl/>
</packing>
</child>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 6
.:5:16 element 'widget' requires attribute 'name'

View File

@ -0,0 +1,8 @@
<!-- missing focus chain widget name attribute -->
<interface>
<object class="GtkBox">
<focus-chain>
<widget/>
</focus-chain>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 6
.:5:28 element 'widget' requires attribute 'name'

View File

@ -0,0 +1,8 @@
<!-- wrong focus chain widget name attribute -->
<interface>
<object class="GtkBox">
<focus-chain>
<widget food="good"/>
</focus-chain>
</object>
</interface>

View File

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

View File

@ -0,0 +1,8 @@
<!-- wrong focus chain element -->
<interface>
<object class="GtkBox">
<focus-chain>
<warbl/>
</focus-chain>
</object>
</interface>

View File

@ -0,0 +1,2 @@
ERROR: g-markup-error-quark 4
.:7:1 attribute 'try' invalid for element 'packing'

View File

@ -0,0 +1,10 @@
<!-- invalid container packing attribute -->
<interface>
<object class="GtkBox">
<child>
<object class="GtkLabel" id="widget1"/>
<packing try="this">
</packing>
</child>
</object>
</interface>