Revert "gdbus-connection-loss: Fix leak in test"
[platform/upstream/glib.git] / gio / tests / gdbus-connection-loss.c
index 59fca7a..ed4142d 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "gdbus-tests.h"
 
-static const gchar *datapath;
-
 /* all tests rely on a global connection */
 static GDBusConnection *c = NULL;
 
@@ -116,11 +114,6 @@ main (int   argc,
   gint ret;
   gchar *path;
 
-  if (g_getenv ("G_TEST_DATA"))
-    datapath = g_getenv ("G_TEST_DATA");
-  else
-    datapath = SRCDIR;
-
   g_test_init (&argc, &argv, NULL);
 
   /* all the tests rely on a shared main loop */
@@ -129,7 +122,7 @@ main (int   argc,
   session_bus_up ();
 
   /* this is safe; testserver will exit once the bus goes away */
-  path = g_build_filename (datapath, "gdbus-testserver", NULL);
+  path = g_test_build_filename (G_TEST_BUILT, "gdbus-testserver", NULL);
   g_assert (g_spawn_command_line_async (path, NULL));
   g_free (path);