[json-glib] parser: Use the proper GLib API to find test data files



commit b8baa2a07e6b125f38a3a9a0101cf9b887790ea5
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Aug 22 11:50:14 2013 +0100

    parser: Use the proper GLib API to find test data files
    
    Instead of our homegrown solution. This should fix the regression in the
    installed tests case.
    
    Original patch by: Colin Walters <walters verbum org>

 json-glib/tests/Makefile.am |    1 -
 json-glib/tests/parser.c    |    7 +------
 2 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/json-glib/tests/Makefile.am b/json-glib/tests/Makefile.am
index f6fd46d..b0588d1 100644
--- a/json-glib/tests/Makefile.am
+++ b/json-glib/tests/Makefile.am
@@ -5,7 +5,6 @@ LDADD = $(top_builddir)/json-glib//libjson-glib-1.0.la $(JSON_LIBS)
 AM_CPPFLAGS = \
        $(JSON_DEBUG_CFLAGS) \
        -DG_LOG_DOMAIN=\"Json\" \
-       -DTESTS_DATA_DIR=\""$(top_srcdir)/json-glib/tests"\" \
        -I$(top_srcdir) \
        -I$(top_srcdir)/json-glib \
        $(NULL)
diff --git a/json-glib/tests/parser.c b/json-glib/tests/parser.c
index 3566217..0841c0f 100644
--- a/json-glib/tests/parser.c
+++ b/json-glib/tests/parser.c
@@ -713,14 +713,9 @@ test_stream_async (void)
   JsonParser *parser = json_parser_new ();
   GFile *file;
   GFileInputStream *stream;
-  const char *tests_data_dir;
   char *path;
 
-  tests_data_dir = g_getenv ("JSON_TEST_DATA");
-  if (tests_data_dir == NULL || *tests_data_dir == '\0')
-    tests_data_dir = TESTS_DATA_DIR;
-
-  path = g_build_filename (tests_data_dir, "stream-load.json", NULL);
+  path = g_test_build_filename (G_TEST_DIST, "stream-load.json", NULL);
   file = g_file_new_for_path (path);
   stream = g_file_read (file, NULL, &error);
   g_assert (error == NULL);


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