gdbus-proxy: Fix erroneous timeout during following tests

Modified by Philip Withnall to amend a second instance in the same
file.

https://bugzilla.gnome.org/show_bug.cgi?id=711809
This commit is contained in:
Stef Walter 2013-11-09 20:24:02 +01:00 committed by Philip Withnall
parent 767296db9c
commit 0f82ff12ea

View File

@ -835,6 +835,8 @@ fail_test (gpointer user_data)
static void static void
test_async (void) test_async (void)
{ {
guint id;
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE, G_DBUS_PROXY_FLAGS_NONE,
NULL, /* GDBusInterfaceInfo */ NULL, /* GDBusInterfaceInfo */
@ -848,8 +850,10 @@ test_async (void)
/* this is safe; testserver will exit once the bus goes away */ /* this is safe; testserver will exit once the bus goes away */
g_assert (g_spawn_command_line_async (g_test_get_filename (G_TEST_BUILT, "gdbus-testserver", NULL), NULL)); g_assert (g_spawn_command_line_async (g_test_get_filename (G_TEST_BUILT, "gdbus-testserver", NULL), NULL));
g_timeout_add (10000, fail_test, NULL); id = g_timeout_add (10000, fail_test, NULL);
g_main_loop_run (loop); g_main_loop_run (loop);
g_source_remove (id);
} }
static void static void
@ -895,6 +899,7 @@ test_wellknown_noauto (void)
{ {
GError *error = NULL; GError *error = NULL;
GDBusProxy *proxy; GDBusProxy *proxy;
guint id;
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
@ -904,9 +909,10 @@ test_wellknown_noauto (void)
g_assert (proxy != NULL); g_assert (proxy != NULL);
g_dbus_proxy_call (proxy, "method", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, check_error, NULL); g_dbus_proxy_call (proxy, "method", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, check_error, NULL);
g_timeout_add (10000, fail_test, NULL); id = g_timeout_add (10000, fail_test, NULL);
g_main_loop_run (loop); g_main_loop_run (loop);
g_object_unref (proxy); g_object_unref (proxy);
g_source_remove (id);
} }
int int