diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-03-31 16:10:14 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-01 14:45:06 +0100 |
commit | ebe49a947d0716fd11f6a8c52b435caf9f619f8f (patch) | |
tree | 8eb4af3a7b6bf7c62e0b8f8f3c5dc706aa0332c1 | |
parent | 314705339a7888cb6b09b6bf7e2bd00f32a8229c (diff) |
Restore lost test coverage from get-interface-after-invalidate testnext-factory
-rw-r--r-- | tests/dbus/call-cancellation.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/dbus/call-cancellation.c b/tests/dbus/call-cancellation.c index f4386f32c..acbafd602 100644 --- a/tests/dbus/call-cancellation.c +++ b/tests/dbus/call-cancellation.c @@ -238,18 +238,21 @@ new_proxy (Fixture *f, int which) { TpClientFactory *local_factory; + TpProxy *ret; if (which == TEST_F) local_factory = f->private_factory; else local_factory = f->factory; - return tp_tests_object_new_static_class (TP_TYPE_PROXY, + ret = tp_tests_object_new_static_class (TP_TYPE_PROXY, "bus-name", g_dbus_connection_get_unique_name ( tp_client_factory_get_dbus_connection (f->factory)), "object-path", "/", "factory", local_factory, NULL); + tp_proxy_add_interface_by_id (ret, TP_IFACE_QUARK_CHANNEL_DISPATCHER); + return ret; } static void @@ -260,6 +263,8 @@ test (Fixture *f, GError err = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Because I said so" }; TpProxyPendingCall *pc; guint i; + GError *error = NULL; + gboolean still_alive; g_message ("Creating proxies"); @@ -302,7 +307,23 @@ test (Fixture *f, destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), ""); g_message ("Forcibly invalidating c"); + + still_alive = tp_proxy_check_interface_by_id (f->proxies[TEST_C], + TP_IFACE_QUARK_CHANNEL_DISPATCHER, &error); + g_assert_no_error (error); + g_assert (still_alive); + tp_proxy_invalidate (f->proxies[TEST_C], &err); + + /* previously tested by get-interface-after-invalidate.c, but + * that test has been removed because it used TpDBusDaemon directly */ + still_alive = tp_proxy_check_interface_by_id (f->proxies[TEST_C], + TP_IFACE_QUARK_CHANNEL_DISPATCHER, &error); + g_assert_error (error, err.domain, err.code); + g_assert_cmpstr (error->message, ==, err.message); + g_assert (!still_alive); + g_error_free (error); + MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_C), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_C), ""); |