File: 0001-Fix-unit-tests.patch

package info (click to toggle)
zeitgeist 0.9.14-2.2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,500 kB
  • ctags: 4,031
  • sloc: ansic: 16,835; sh: 11,484; xml: 8,822; python: 8,196; cpp: 2,970; sql: 1,192; makefile: 941
file content (60 lines) | stat: -rw-r--r-- 2,007 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 42f0f6b0f17a584b703981b8a392c3225c7a8e98 Mon Sep 17 00:00:00 2001
From: Seif Lotfy <seif@lotfy.com>
Date: Thu, 2 Jan 2014 08:09:01 +0100
Subject: [PATCH] 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
---
 libzeitgeist/event.vala  | 4 ++--
 test/c/test-datasource.c | 3 +--
 test/c/test-event.c      | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/libzeitgeist/event.vala b/libzeitgeist/event.vala
index 67fe47f..0cd708c 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 a60d48b..067da55 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 746de3d..440d3c3 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);
 }
 
-- 
2.0.0