glib/gio/tests/org.gtk.test.gschema.xml.orig
Michael Catanzaro 92de7298c8 Add test for l10n="time" gschema attribute
This is a copy of the existing test_l10n, modified to use LC_TIME
instead of LC_MESSAGES. It's not safe as each call to g_setenv() or
setlocale() could cause the test to crash; there is no safe way to
change a threaded process's environment, and a threaded process's locale
can only be safely changed using uselocale(), not with setlocale().

The calls to g_setenv() are definitely not needed on Linux. I wonder
whether removing these will break the test on other platforms?

The calls to setlocale() should be replaced by a dance of
uselocale() -> duplocale() -> newlocale() -> uselocale() on Linux. But
this is not portable and this is a cross-platform test. We would have to
make the test platform-specific to do this. macOS and at least FreeBSD
provide these functions via xlocale.h, but this isn't portable.
2023-08-03 09:16:26 -05:00

226 lines
5.8 KiB
XML

<schemalist>
<schema id="org.gtk.test" path="/tests/" gettext-domain="test">
<key name="greeting" type="s">
<default l10n="messages">"Hello, earthlings"</default>
<summary>A greeting</summary>
<description>
Greeting of the invading martians
</description>
</key>
<key name="farewell" type="s">
<default l10n="messages">"So long"</default>
</key>
<child name='basic-types' schema='org.gtk.test.basic-types'/>
<child name='complex-types' schema='org.gtk.test.complex-types'/>
<child name='localized' schema='org.gtk.test.localized'/>
</schema>
<schema id="org.gtk.test.no-path">
<key name="test-boolean" type="b">
<default>true</default>
</key>
</schema>
<schema id="org.gtk.test.basic-types" path="/tests/basic-types/">
<key name="test-boolean" type="b">
<default>true</default>
</key>
<key name="test-byte" type="y">
<default>25</default>
</key>
<key name="test-int16" type="n">
<default>-1234</default>
</key>
<key name="test-uint16" type="q">
<default>1234</default>
</key>
<key name="test-int32" type="i">
<default>-123456</default>
</key>
<key name="test-uint32" type="u">
<default>123456</default>
</key>
<key name="test-int64" type="x">
<default>-123456789</default>
</key>
<key name="test-uint64" type="t">
<default>123456789</default>
</key>
<key name="test-double" type="d">
<default>123.456</default>
</key>
<key name="test-string" type="s">
<default>"a string, it seems"</default>
</key>
<key name="test-objectpath" type="o">
<default>"/a/object/path"</default>
</key>
</schema>
<schema id="org.gtk.test.complex-types" path="/tests/complex-types/">
<key name="test-tuple" type="(s(ii))">
<default>("one",(2,3))</default>
</key>
<key name="test-array" type="ai">
<default>[0,1,2,3,4,5]</default>
</key>
<key name="test-dict" type="a{sau}">
<default>
{
"AC": [0,0, 0,0,0,0,0,0],
"IV": [0,0, 0,0,0,0,0,0]
}
</default>
</key>
</schema>
<schema id="org.gtk.test.localized" path="/tests/localized/" gettext-domain="test">
<key name="error-message" type="s">
<default l10n="messages">"Unnamed"</default>
</key>
<key name="backspace" type="s">
<default l10n="messages" context="keyboard label">"BackSpace"</default>
</key>
<key name="midnight" type="s">
<default l10n="time">"12:00 AM"</default>
</key>
</schema>
<schema id="org.gtk.test.binding" path="/tests/binding/">
<key name="bool" type="b">
<default>false</default>
</key>
<key name="anti-bool" type="b">
<default>false</default>
</key>
<key name="byte" type="y">
<default>0</default>
</key>
<key name="int16" type="n">
<default>0</default>
</key>
<key name="uint16" type="q">
<default>0</default>
</key>
<key name="int" type="i">
<default>0</default>
</key>
<key name="uint" type="u">
<default>0</default>
</key>
<key name="int64" type="x">
<default>0</default>
</key>
<key name="uint64" type="t">
<default>0</default>
</key>
<key name="double" type="d">
<default>0</default>
</key>
<key name="string" type="s">
<default>""</default>
</key>
<key name="chararray" type="ay">
<default>[48, 49]</default>
</key>
<key name="strv" type="as">
<default>[]</default>
</key>
<key name="enum" enum="org.gtk.test.TestEnum">
<default>'foo'</default>
</key>
<key name="flags" flags="org.gtk.test.TestFlags">
<default>['mourning', 'laughing']</default>
</key>
<key name="range" type='u'>
<default>33</default>
<range min="2" max="44"/>
</key>
</schema>
<schema id='org.gtk.test.enums' path='/tests/enums/'>
<key name='test' enum='org.gtk.test.TestEnum'>
<default>'bar'</default>
<aliases>
<alias value='qux' target='quux'/>
</aliases>
</key>
<key name='f-test' flags='org.gtk.test.TestFlags'>
<default>[]</default>
<aliases>
<alias value='speaking' target='talking'/>
</aliases>
</key>
</schema>
<schema id='org.gtk.test.enums.direct' path='/tests/enums/'>
<key name='f-test' type='as'>
<default>[]</default>
</key>
<key name='test' type='s'>
<default>'bar'</default>
</key>
</schema>
<schema id='org.gtk.test.range' path='/tests/range/'>
<key name='val' type='i'>
<default>33</default>
<range min='2' max='44'/>
</key>
</schema>
<schema id='org.gtk.test.range.direct' path='/tests/range/'>
<key name='val' type='i'>
<default>33</default>
</key>
</schema>
<schema id='org.gtk.test.mapped' path='/tests/mapped/'>
<key name='val' type='i'>
<default>0</default>
</key>
</schema>
<schema id="org.gtk.test.descriptions" path="/a/">
<key name='a' type='i'>
<summary>
a paragraph.
with some whitespace.
because not everyone has a great editor.
lots of space is as one.
</summary>
<default>0</default>
</key>
</schema>
<schema id='org.gtk.test.extends.base'>
<key name='int32' type='i'>
<default>0</default>
</key>
<key name='string' type='s'>
<default>''</default>
</key>
</schema>
<schema id='org.gtk.test.extends.extended' extends='org.gtk.test.extends.base'>
<override name="int32">42</override>
<key name='another-int32' type='i'>
<default>0</default>
</key>
</schema>
<schema id="org.gtk.test.per-desktop" path="/tests/per-desktop/">
<key name="desktop" type="s">
<default>"GNOME"</default>
</key>
</schema>
</schemalist>