From 2d8217676a5765fa580d48f37310ecc0b2c8a5f1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 28 Feb 2014 16:26:12 +0100 Subject: [PATCH 2/4] test creating a TpProtocol by passing its immutable props --- tests/dbus/protocol-objects.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/dbus/protocol-objects.c b/tests/dbus/protocol-objects.c index 5a75156..5498d4c 100644 --- a/tests/dbus/protocol-objects.c +++ b/tests/dbus/protocol-objects.c @@ -451,6 +451,9 @@ static void test_protocol_object (Test *test, gconstpointer data G_GNUC_UNUSED) { + GHashTable *props; + TpProtocol *protocol; + g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "example_echo_2"); tp_tests_proxy_run_until_prepared (test->cm, NULL); @@ -458,6 +461,22 @@ test_protocol_object (Test *test, tp_connection_manager_get_protocol_object (test->cm, "example")); check_tp_protocol (test->protocol); + + /* Create a new TpProtocol for the same protocol but by passing it all its + * immutable properities */ + g_object_get (test->protocol, + "protocol-properties", &props, + NULL); + + protocol = tp_protocol_new (test->dbus, "example_echo_2", + "example", props, &test->error); + g_assert_no_error (test->error); + g_assert (TP_IS_PROTOCOL (protocol)); + + check_tp_protocol (protocol); + + g_object_unref (protocol); + g_hash_table_unref (props); } static void -- 1.8.5.3