[glib] Test g_settings_list_schemas
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Test g_settings_list_schemas
- Date: Fri, 30 Jul 2010 23:57:39 +0000 (UTC)
commit b77a19f238e34cd2ba7ecf204beacc7252477605
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 27 01:00:55 2010 -0400
Test g_settings_list_schemas
gio/tests/gsettings.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
index 02319b9..864871c 100644
--- a/gio/tests/gsettings.c
+++ b/gio/tests/gsettings.c
@@ -1737,6 +1737,28 @@ test_list_items (void)
g_object_unref (settings);
}
+static void
+test_list_schemas (void)
+{
+ const gchar * const *schemas;
+
+ schemas = g_settings_list_schemas ();
+
+ g_assert (strv_set_equal ((const gchar **)schemas,
+ "org.gtk.test",
+ "org.gtk.test.no-path",
+ "org.gtk.test.basic-types",
+ "org.gtk.test.complex-types",
+ "org.gtk.test.localized",
+ "org.gtk.test.binding",
+ "org.gtk.test.enums",
+ "org.gtk.test.enums.direct",
+ "org.gtk.test.range",
+ "org.gtk.test.range.direct",
+ "org.gtk.test.mapped",
+ NULL));
+}
+
static gboolean
map_func (GVariant *value,
gpointer *result,
@@ -1800,6 +1822,7 @@ main (int argc, char *argv[])
backend_set = g_getenv ("GSETTINGS_BACKEND") != NULL;
+ g_setenv ("XDG_DATA_DIRS", ".", TRUE);
g_setenv ("GSETTINGS_SCHEMA_DIR", ".", TRUE);
if (!backend_set)
@@ -1870,6 +1893,7 @@ main (int argc, char *argv[])
g_test_add_func ("/gsettings/flags", test_flags);
g_test_add_func ("/gsettings/range", test_range);
g_test_add_func ("/gsettings/list-items", test_list_items);
+ g_test_add_func ("/gsettings/list-schemas", test_list_schemas);
g_test_add_func ("/gsettings/mapped", test_get_mapped);
result = g_test_run ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]