diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-03-18 18:19:48 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-03-18 18:25:43 +0000 |
commit | 2528541c571fb02869ba55db99043e1e7cb45b99 (patch) | |
tree | ed8d5b05db518d03717400493259319d1ca1cd91 /tests | |
parent | 117b9ee1257cfbcbe3f3fb88f3ec149358f4cea0 (diff) |
callable-example test: factor out connecting to signals
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dbus/callable-example.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/tests/dbus/callable-example.c b/tests/dbus/callable-example.c index ade7b70ce..b6999687e 100644 --- a/tests/dbus/callable-example.c +++ b/tests/dbus/callable-example.c @@ -502,6 +502,25 @@ stream_state_changed_cb (TpChannel *chan G_GNUC_UNUSED, } static void +test_connect_channel_signals (Test *test) +{ + test->members_changed_detailed_id = g_signal_connect (test->chan, + "group-members-changed-detailed", + G_CALLBACK (members_changed_detailed_cb), test); + + tp_cli_channel_type_streamed_media_connect_to_stream_added (test->chan, + stream_added_cb, test, NULL, NULL, NULL); + tp_cli_channel_type_streamed_media_connect_to_stream_removed (test->chan, + stream_removed_cb, test, NULL, NULL, NULL); + tp_cli_channel_type_streamed_media_connect_to_stream_error (test->chan, + stream_error_cb, test, NULL, NULL, NULL); + tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed ( + test->chan, stream_direction_changed_cb, test, NULL, NULL, NULL); + tp_cli_channel_type_streamed_media_connect_to_stream_state_changed ( + test->chan, stream_state_changed_cb, test, NULL, NULL, NULL); +} + +static void outgoing_call (Test *test, const gchar *id) { @@ -525,20 +544,7 @@ outgoing_call (Test *test, tp_channel_call_when_ready (test->chan, channel_ready_cb, test); g_main_loop_run (test->mainloop); - test->members_changed_detailed_id = g_signal_connect (test->chan, - "group-members-changed-detailed", - G_CALLBACK (members_changed_detailed_cb), test); - - tp_cli_channel_type_streamed_media_connect_to_stream_added (test->chan, - stream_added_cb, test, NULL, NULL, NULL); - tp_cli_channel_type_streamed_media_connect_to_stream_removed (test->chan, - stream_removed_cb, test, NULL, NULL, NULL); - tp_cli_channel_type_streamed_media_connect_to_stream_error (test->chan, - stream_error_cb, test, NULL, NULL, NULL); - tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed ( - test->chan, stream_direction_changed_cb, test, NULL, NULL, NULL); - tp_cli_channel_type_streamed_media_connect_to_stream_state_changed ( - test->chan, stream_state_changed_cb, test, NULL, NULL, NULL); + test_connect_channel_signals (test); } static void |