diff options
author | David Zeuthen <davidz@redhat.com> | 2011-09-19 17:31:21 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2011-09-19 17:34:06 -0400 |
commit | 0d04b3449e100ecfb68b6c19b0d976a04060292b (patch) | |
tree | fac6782cce9e237424a53a705e40bc8c6b640654 | |
parent | 39ae9ee5e8d6ee462c68fac1f7a4ccdab01ddc62 (diff) |
GDBusObjectManagerServer: Add test for export_uniquely() method
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r-- | gio/tests/gdbus-test-codegen.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c index e7ed43fd2..ebc71adeb 100644 --- a/gio/tests/gdbus-test-codegen.c +++ b/gio/tests/gdbus-test-codegen.c @@ -1643,6 +1643,13 @@ om_on_signal (GDBusConnection *connection, om_data->state = 104; g_main_loop_quit (om_data->loop); break; + + case 200: + om_check_interfaces_added (signal_name, parameters, "/managed/first_1", + "com.acme.Coyote", NULL); + om_data->state = 201; + g_main_loop_quit (om_data->loop); + break; } } @@ -1731,6 +1738,7 @@ check_object_manager (void) { FooiGenObjectSkeleton *o; FooiGenObjectSkeleton *o2; + FooiGenObjectSkeleton *o3; GDBusInterfaceSkeleton *i; GDBusConnection *c; GDBusObjectManagerServer *manager; @@ -2095,11 +2103,30 @@ check_object_manager (void) om_check_get_all (c, loop, "({objectpath '/managed/first': {'com.acme.Coyote': {'Mood': <''>}}},)"); + /* -------------------------------------------------- */ + + /* Check that export_uniquely() works */ + + o3 = foo_igen_object_skeleton_new ("/managed/first"); + i = G_DBUS_INTERFACE_SKELETON (foo_igen_com_acme_coyote_skeleton_new ()); + foo_igen_com_acme_coyote_set_mood (FOO_IGEN_COM_ACME_COYOTE (i), "indifferent"); + foo_igen_object_skeleton_set_com_acme_coyote (o3, FOO_IGEN_COM_ACME_COYOTE (i)); + g_object_unref (i); + g_dbus_object_manager_server_export_uniquely (manager, G_DBUS_OBJECT_SKELETON (o3)); + /* ... check we get the InterfacesAdded signal */ + om_data->state = 200; + g_main_loop_run (om_data->loop); + g_assert_cmpint (om_data->state, ==, 201); + + om_check_get_all (c, loop, + "({objectpath '/managed/first': {'com.acme.Coyote': {'Mood': <''>}}, '/managed/first_1': {'com.acme.Coyote': {'Mood': <'indifferent'>}}},)"); + //g_main_loop_run (loop); /* TODO: tmp */ g_main_loop_unref (loop); g_dbus_connection_signal_unsubscribe (c, om_signal_id); + g_object_unref (o3); g_object_unref (o2); g_object_unref (o); g_object_unref (manager); |