From a8511b2def7fc33b11d8e25aa38ce921b3e092e9 Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Mon, 5 Aug 2019 12:07:36 -0700 Subject: tests: Don't use GSubprocessLauncher It crashes on Windows --- tests/test-fullmode-with-stun.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/test-fullmode-with-stun.c b/tests/test-fullmode-with-stun.c index 67d35f2..280d421 100644 --- a/tests/test-fullmode-with-stun.c +++ b/tests/test-fullmode-with-stun.c @@ -6,7 +6,6 @@ main (int argc, char ** argv) int retval = 0; char *stund; char *test_fullmode; - GSubprocessLauncher *launcher; GSubprocess *stund_proc, *test_subprocess; const gchar NICE_STUN_SERVER[] = "127.0.0.1"; const gchar NICE_STUN_SERVER_PORT[] = "3800"; @@ -30,23 +29,19 @@ main (int argc, char ** argv) g_usleep(G_USEC_PER_SEC); - launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE); + g_setenv("NICE_STUN_SERVER", NICE_STUN_SERVER, TRUE); + g_setenv("NICE_STUN_SERVER_PORT", NICE_STUN_SERVER_PORT, TRUE); - g_subprocess_launcher_setenv (launcher, "NICE_STUN_SERVER", NICE_STUN_SERVER, - TRUE); - g_subprocess_launcher_setenv (launcher, "NICE_STUN_SERVER_PORT", - NICE_STUN_SERVER_PORT, TRUE); g_print ("Running test fullmode as %s\n", test_fullmode); - test_subprocess = g_subprocess_launcher_spawn (launcher, &gerr, - test_fullmode, NULL); + test_subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_NONE, &gerr, + test_fullmode, NULL); g_assert_no_error (gerr); g_subprocess_wait (test_subprocess, NULL, &gerr); g_assert_no_error (gerr); retval = g_subprocess_get_exit_status (test_subprocess); g_print ("Test process returned %d\n", retval); g_object_unref (test_subprocess); - g_object_unref (launcher); - + g_subprocess_force_exit (stund_proc); g_subprocess_wait (stund_proc, NULL, &gerr); g_assert_no_error (gerr); -- cgit v1.2.1