[tracker] tests/libtracker-extract: Do not use tracker_coalesce_strip on constant strings.



commit cdc2239c198544c714a73ef1a1c8dc27bab6da17
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Wed Jan 18 13:42:07 2012 +0200

    tests/libtracker-extract: Do not use tracker_coalesce_strip on constant strings.

 tests/libtracker-extract/tracker-test-utils.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-extract/tracker-test-utils.c b/tests/libtracker-extract/tracker-test-utils.c
index 25f31d8..ee98bba 100644
--- a/tests/libtracker-extract/tracker-test-utils.c
+++ b/tests/libtracker-extract/tracker-test-utils.c
@@ -213,7 +213,13 @@ test_coalesce_strip ()
 {
         /* Used in other tests, but this one can try some corner cases */
         g_assert (!tracker_coalesce_strip (0, NULL));
-        g_assert_cmpstr (tracker_coalesce_strip (2, "", "a", NULL), ==, "a");
+
+        /* Allocate, do not use constant strings */
+        char *e = g_strdup ("");
+        char *a = g_strdup ("a");
+        g_assert_cmpstr (tracker_coalesce_strip (2, e, a, NULL), ==, "a");
+        g_free (e);
+        g_free (a);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]