summaryrefslogtreecommitdiff
path: root/tests/iochannel-test.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-05-20 21:05:56 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-05-20 23:41:49 -0400
commit7ff5c082213c13c893f583f2bce77fa63a146af2 (patch)
tree0c4438a47b6ff95f102b52d718be5dad09f0d16c /tests/iochannel-test.c
parent1808888a1f543276f83d65ef41a5cadb5f31c388 (diff)
downloadglib-7ff5c082213c13c893f583f2bce77fa63a146af2.tar.gz
Convert more tests to installed tests
This makes the tests in tests installed, except for the performance tests.
Diffstat (limited to 'tests/iochannel-test.c')
-rw-r--r--tests/iochannel-test.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/iochannel-test.c b/tests/iochannel-test.c
index 492b47e20..81c04daa5 100644
--- a/tests/iochannel-test.c
+++ b/tests/iochannel-test.c
@@ -11,6 +11,8 @@
#define BUFFER_SIZE 1024
+static const gchar *datapath;
+
static void
test_small_writes (void)
{
@@ -58,16 +60,18 @@ gint main (gint argc, gchar * argv[])
GError *gerr = NULL;
GString *buffer;
char *filename;
- char *srcdir = getenv ("srcdir");
gint rlength = 0;
glong wlength = 0;
gsize length_out;
const gchar encoding[] = "EUC-JP";
GIOStatus status;
- if (!srcdir)
- srcdir = ".";
- filename = g_strconcat (srcdir, G_DIR_SEPARATOR_S, "iochannel-test-infile", NULL);
+ if (g_getenv ("G_TEST_DATA"))
+ datapath = g_getenv ("G_TEST_DATA");
+ else
+ datapath = ".";
+
+ filename = g_build_filename (datapath, "iochannel-test-infile", NULL);
setbuf (stdout, NULL); /* For debugging */