mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
Merge branch 'gdbus-proxy-test-fixes' into 'master'
gdbus-proxy test fails with GLib-GIO:ERROR:glib/gio/tests/gdbus-proxy.c:832:fail_test: code should not be reached See merge request GNOME/glib!598
This commit is contained in:
commit
1275ddb794
@ -766,6 +766,7 @@ test_proxy (void)
|
|||||||
GDBusProxy *proxy;
|
GDBusProxy *proxy;
|
||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
gchar *owner;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
|
connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
|
||||||
@ -783,7 +784,7 @@ test_proxy (void)
|
|||||||
&error);
|
&error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
|
||||||
/* this is safe; testserver will exit once the bus goes away */
|
/* this is safe; we explicitly kill the service later on */
|
||||||
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_assert_property_notify (proxy, "g-name-owner");
|
_g_assert_property_notify (proxy, "g-name-owner");
|
||||||
@ -794,8 +795,15 @@ test_proxy (void)
|
|||||||
test_signals (proxy);
|
test_signals (proxy);
|
||||||
test_expected_interface (proxy);
|
test_expected_interface (proxy);
|
||||||
|
|
||||||
g_object_unref (proxy);
|
|
||||||
kill_test_service (connection);
|
kill_test_service (connection);
|
||||||
|
|
||||||
|
_g_assert_property_notify (proxy, "g-name-owner");
|
||||||
|
|
||||||
|
owner = g_dbus_proxy_get_name_owner (proxy);
|
||||||
|
g_assert_null (owner);
|
||||||
|
g_free (owner);
|
||||||
|
|
||||||
|
g_object_unref (proxy);
|
||||||
g_object_unref (connection);
|
g_object_unref (connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,11 +816,19 @@ proxy_ready (GObject *source,
|
|||||||
{
|
{
|
||||||
GDBusProxy *proxy;
|
GDBusProxy *proxy;
|
||||||
GError *error;
|
GError *error;
|
||||||
|
gchar *owner;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
|
proxy = g_dbus_proxy_new_for_bus_finish (result, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
|
||||||
|
owner = g_dbus_proxy_get_name_owner (proxy);
|
||||||
|
g_assert_null (owner);
|
||||||
|
g_free (owner);
|
||||||
|
|
||||||
|
/* this is safe; we explicitly kill the service later on */
|
||||||
|
g_assert (g_spawn_command_line_async (g_test_get_filename (G_TEST_BUILT, "gdbus-testserver", NULL), NULL));
|
||||||
|
|
||||||
_g_assert_property_notify (proxy, "g-name-owner");
|
_g_assert_property_notify (proxy, "g-name-owner");
|
||||||
|
|
||||||
test_basic (proxy);
|
test_basic (proxy);
|
||||||
@ -847,9 +863,6 @@ test_async (void)
|
|||||||
proxy_ready,
|
proxy_ready,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* 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));
|
|
||||||
|
|
||||||
id = 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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user