[tracker] tests: ensure XMP test files are found when srcdir != builddir
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tests: ensure XMP test files are found when srcdir != builddir
- Date: Thu, 8 Sep 2011 14:39:45 +0000 (UTC)
commit 690c5319bdcea0fc3af2f36926311239e1825f5c
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Sep 8 16:16:53 2011 +0200
tests: ensure XMP test files are found when srcdir != builddir
tests/libtracker-extract/tracker-test-xmp.c | 50 +++++++++++++++------------
1 files changed, 28 insertions(+), 22 deletions(-)
---
diff --git a/tests/libtracker-extract/tracker-test-xmp.c b/tests/libtracker-extract/tracker-test-xmp.c
index 0df4746..ecd5324 100644
--- a/tests/libtracker-extract/tracker-test-xmp.c
+++ b/tests/libtracker-extract/tracker-test-xmp.c
@@ -374,19 +374,19 @@ debug_print_sparql (TrackerXmpData *data)
static void
test_xmp_regions (void)
{
- TrackerXmpData *data;
- TrackerXmpRegion *region;
-
- GFile *f;
- gchar *contents;
- gsize size;
-
-
+ TrackerXmpData *data;
+ TrackerXmpRegion *region;
+ GFile *f;
+ gchar *contents;
+ gsize size;
+ gchar *filepath;
- f = g_file_new_for_path ("./areas.xmp");
- g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
+ filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas.xmp", NULL);
+ f = g_file_new_for_path (filepath);
+ g_assert (g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
g_object_unref (f);
+ g_free (filepath);
data = tracker_xmp_new (contents, size, "test://file");
@@ -420,16 +420,19 @@ test_xmp_regions (void)
static void
test_xmp_regions_quill (void)
{
- TrackerXmpData *data;
+ TrackerXmpData *data;
TrackerXmpRegion *region;
- GFile *f;
- gchar *contents;
- gsize size;
+ GFile *f;
+ gchar *contents;
+ gsize size;
+ gchar *filepath;
- f = g_file_new_for_path ("./areas-with-contacts.xmp");
- g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
+ filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas-with-contacts.xmp", NULL);
+ f = g_file_new_for_path (filepath);
+ g_assert (g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
g_object_unref (f);
+ g_free (filepath);
data = tracker_xmp_new (contents, size, "test://file");
@@ -463,16 +466,19 @@ test_xmp_regions_quill (void)
static void
test_xmp_regions_ns_prefix (void)
{
- TrackerXmpData *data;
- TrackerXmpRegion *region;
+ TrackerXmpData *data;
+ TrackerXmpRegion *region;
- GFile *f;
- gchar *contents;
- gsize size;
+ GFile *f;
+ gchar *contents;
+ gsize size;
+ gchar *filepath;
- f = g_file_new_for_path ("./areas-ns.xmp");
+ filepath = g_build_filename (TOP_SRCDIR, "tests", "libtracker-extract", "areas-ns.xmp", NULL);
+ f = g_file_new_for_path (filepath);
g_assert(g_file_load_contents (f, NULL, &contents, &size, NULL, NULL));
g_object_unref (f);
+ g_free (filepath);
data = tracker_xmp_new (contents, size, "test://file");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]