[glib] Improve keyfile test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve keyfile test coverage
- Date: Tue, 6 Jul 2010 04:03:22 +0000 (UTC)
commit eea9d343ccd059b8d53009d64197ff343338c05f
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 6 00:01:40 2010 -0400
Improve keyfile test coverage
glib/tests/keyfile.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/keyfile.c b/glib/tests/keyfile.c
index b8e1db2..de815a1 100644
--- a/glib/tests/keyfile.c
+++ b/glib/tests/keyfile.c
@@ -1278,6 +1278,28 @@ test_int64 (void)
g_key_file_free (file);
}
+static void
+test_load (void)
+{
+ GKeyFile *file;
+ GError *error;
+ gboolean bools[2] = { TRUE, FALSE };
+
+ g_setenv ("XDG_DATA_HOME", SRCDIR, TRUE);
+
+ file = g_key_file_new ();
+ g_assert (g_key_file_load_from_data_dirs (file, "keyfiletest.ini", NULL, 0, &error));
+ g_assert_no_error (error);
+
+ g_key_file_set_locale_string (file, "test", "key4", "de", "Vierter Schlüssel");
+ g_key_file_set_boolean_list (file, "test", "key5", bools, 2);
+ g_key_file_set_integer (file, "test", "key6", 22);
+ g_key_file_set_double (file, "test", "key7", 2.5);
+ g_key_file_set_comment (file, "test", "key7", "some float", NULL);
+
+ g_key_file_free (file);
+}
+
int
main (int argc, char *argv[])
{
@@ -1304,6 +1326,7 @@ main (int argc, char *argv[])
g_test_add_func ("/keyfile/key-names", test_key_names);
g_test_add_func ("/keyfile/reload", test_reload_idempotency);
g_test_add_func ("/keyfile/int64", test_int64);
+ g_test_add_func ("/keyfile/load", test_load);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]