[glib] Fix problems with the keyfile test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Fix problems with the keyfile test
- Date: Tue, 6 Jul 2010 11:49:05 +0000 (UTC)
commit f0b6cbb13951549b9e17ee0366fc5be3e4b69f2f
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jul 6 07:43:19 2010 -0400
Fix problems with the keyfile test
We must set XDG_DATA_HOME early on, and we must clear error
before using it.
glib/tests/keyfile.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/keyfile.c b/glib/tests/keyfile.c
index de815a1..058e7fd 100644
--- a/glib/tests/keyfile.c
+++ b/glib/tests/keyfile.c
@@ -1285,9 +1285,8 @@ test_load (void)
GError *error;
gboolean bools[2] = { TRUE, FALSE };
- g_setenv ("XDG_DATA_HOME", SRCDIR, TRUE);
-
file = g_key_file_new ();
+ error = NULL;
g_assert (g_key_file_load_from_data_dirs (file, "keyfiletest.ini", NULL, 0, &error));
g_assert_no_error (error);
@@ -1300,9 +1299,15 @@ test_load (void)
g_key_file_free (file);
}
+#ifndef SRCDIR
+#define SRCDIR "."
+#endif
+
int
main (int argc, char *argv[])
{
+ g_setenv ("XDG_DATA_HOME", SRCDIR, TRUE);
+
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]