From 3295acc65bb0e1fea6f10e4aca2a447e4d62db54 Mon Sep 17 00:00:00 2001 From: Mikael Ottela Date: Wed, 18 Jan 2012 13:42:07 +0200 Subject: tests/libtracker-extract: Do not use tracker_coalesce_strip on constant strings. --- tests/libtracker-extract/tracker-test-utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/libtracker-extract/tracker-test-utils.c b/tests/libtracker-extract/tracker-test-utils.c index 25f31d8d1..ee98bba78 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 -- cgit v1.2.1