diff options
author | Seif Lotfy <seif@lotfy.com> | 2014-01-02 08:09:01 +0100 |
---|---|---|
committer | Seif Lotfy <seif@lotfy.com> | 2014-01-02 08:09:01 +0100 |
commit | 42f0f6b0f17a584b703981b8a392c3225c7a8e98 (patch) | |
tree | 8b5f609bc93112c21ce7b5fb80568aa8031e7d1f | |
parent | 0498e48b1299acdd5bcae3717b324b9b7615e818 (diff) |
Fix unit-tests
Currently the unit tests failed when loading the xdg directories
and also it seems like optimizing the event variant lead to a
segfault when converting back via from_variant with several events
-rw-r--r-- | libzeitgeist/event.vala | 4 | ||||
-rw-r--r-- | test/c/test-datasource.c | 3 | ||||
-rw-r--r-- | test/c/test-event.c | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/libzeitgeist/event.vala b/libzeitgeist/event.vala index 67fe47fd..0cd708cb 100644 --- a/libzeitgeist/event.vala +++ b/libzeitgeist/event.vala @@ -292,8 +292,8 @@ public class Event : Object } Variant event_variant = vb.end ().get_normal_form (); - Variant ret = optimize_variant_allocation (event_variant); - return ret; + //Variant ret = optimize_variant_allocation (event_variant); + return event_variant; } private Variant optimize_variant_allocation (Variant event_variant) { diff --git a/test/c/test-datasource.c b/test/c/test-datasource.c index a60d48bf..067da558 100644 --- a/test/c/test-datasource.c +++ b/test/c/test-datasource.c @@ -35,8 +35,7 @@ static const gchar *old_xdg_data_dirs = NULL; static void setup (Fixture *fix, gconstpointer data) { - if (old_xdg_data_dirs != NULL) - old_xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); + old_xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); g_setenv ("XDG_DATA_DIRS", TEST_DIR, TRUE); } diff --git a/test/c/test-event.c b/test/c/test-event.c index 746de3de..440d3c30 100644 --- a/test/c/test-event.c +++ b/test/c/test-event.c @@ -35,8 +35,7 @@ static const gchar *old_xdg_data_dirs = NULL; static void setup (Fixture *fix, gconstpointer data) { - if (old_xdg_data_dirs != NULL) - old_xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); + old_xdg_data_dirs = g_getenv ("XDG_DATA_DIRS"); g_setenv ("XDG_DATA_DIRS", TEST_DIR, TRUE); } |