[kdbus] Make SipHash function as a private utility function to kdbus
[platform/upstream/glib.git] / tests / iochannel-test.c
index 57d31c9..06a85e5 100644 (file)
@@ -11,8 +11,6 @@
 
 #define BUFFER_SIZE 1024
 
-static const gchar *datapath;
-
 static void
 test_small_writes (void)
 {
@@ -66,13 +64,10 @@ gint main (gint argc, gchar * argv[])
     const gchar encoding[] = "EUC-JP";
     GIOStatus status;
 
-    if (g_getenv ("G_TEST_DATA"))
-      datapath = g_getenv ("G_TEST_DATA");
-    else
-      datapath = SRCDIR;
+    g_test_init (&argc, &argv, NULL);
+
+    filename = g_test_build_filename (G_TEST_DIST, "iochannel-test-infile", NULL);
 
-    filename = g_build_filename (datapath, "iochannel-test-infile", NULL);
-  
     setbuf (stdout, NULL); /* For debugging */
 
     gio_r = g_io_channel_new_file (filename, "r", &gerr);
@@ -169,6 +164,9 @@ gint main (gint argc, gchar * argv[])
     g_io_channel_unref(gio_w);
 
     test_small_writes ();
-    
+
+    g_free (filename);
+    g_string_free (buffer, TRUE);
+
     return 0;
 }