mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Add test for g_settings_schema_has_key on extended schema
The test checks that the keys of the base schema do all exist in the extended schema. Signed-off-by: Martin Domig <martin.domig@wolfvision.net>
This commit is contained in:
parent
58f9667def
commit
d63d27b195
@ -3248,6 +3248,21 @@ test_extended_schema (void)
|
||||
g_settings_schema_unref (schema);
|
||||
}
|
||||
|
||||
static void
|
||||
test_extended_schema_has_key (void)
|
||||
{
|
||||
GSettingsSchema *schema;
|
||||
GSettings *settings;
|
||||
|
||||
settings = g_settings_new_with_path ("org.gtk.test.extends.extended", "/test/extends/");
|
||||
g_object_get (settings, "settings-schema", &schema, NULL);
|
||||
g_assert_true (g_settings_schema_has_key (schema, "int32"));
|
||||
g_assert_true (g_settings_schema_has_key (schema, "string"));
|
||||
g_assert_true (g_settings_schema_has_key (schema, "another-int32"));
|
||||
g_object_unref (settings);
|
||||
g_settings_schema_unref (schema);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -3429,6 +3444,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/gsettings/memory-backend", test_memory_backend);
|
||||
g_test_add_func ("/gsettings/read-descriptions", test_read_descriptions);
|
||||
g_test_add_func ("/gsettings/test-extended-schema", test_extended_schema);
|
||||
g_test_add_func ("/gsettings/test-extended-schema-has-key", test_extended_schema_has_key);
|
||||
g_test_add_func ("/gsettings/default-value", test_default_value);
|
||||
g_test_add_func ("/gsettings/per-desktop", test_per_desktop);
|
||||
g_test_add_func ("/gsettings/per-desktop/subprocess", test_per_desktop_subprocess);
|
||||
|
Loading…
Reference in New Issue
Block a user