1 /* GStreamer message bus unit tests
2 * Copyright (C) 2005 Andy Wingo <wingo@pobox.com>
3 * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
24 #include <gst/check/gstcheck.h>
26 static GstBus *test_bus = NULL;
27 static GMainLoop *main_loop;
29 static GType foo_device_get_type (void);
31 #define NUM_MESSAGES 1000
32 #define NUM_THREADS 10
35 pound_bus_with_messages (gpointer data)
37 gint thread_id = GPOINTER_TO_INT (data);
40 for (i = 0; i < NUM_MESSAGES; i++) {
44 s = gst_structure_new ("test_message",
45 "thread_id", G_TYPE_INT, thread_id, "msg_id", G_TYPE_INT, i, NULL);
46 m = gst_message_new_application (NULL, s);
47 gst_bus_post (test_bus, m);
56 const GstStructure *s;
57 guint message_ids[NUM_THREADS];
60 for (i = 0; i < NUM_THREADS; i++)
66 m = gst_bus_pop (test_bus);
69 g_return_if_fail (GST_MESSAGE_TYPE (m) == GST_MESSAGE_APPLICATION);
71 s = gst_message_get_structure (m);
72 if (!gst_structure_get_int (s, "thread_id", &_t))
73 g_critical ("Invalid message");
74 if (!gst_structure_get_int (s, "msg_id", &_i))
75 g_critical ("Invalid message");
77 g_return_if_fail (_t < NUM_THREADS);
78 g_return_if_fail (_i == message_ids[_t]++);
80 gst_message_unref (m);
83 for (i = 0; i < NUM_THREADS; i++)
84 g_return_if_fail (message_ids[i] == NUM_MESSAGES);
87 GST_START_TEST (test_hammer_bus)
89 GThread *threads[NUM_THREADS];
92 test_bus = gst_bus_new ();
94 for (i = 0; i < NUM_THREADS; i++)
95 threads[i] = g_thread_try_new ("gst-check", pound_bus_with_messages,
96 GINT_TO_POINTER (i), NULL);
98 for (i = 0; i < NUM_THREADS; i++)
99 g_thread_join (threads[i]);
103 gst_object_unref ((GstObject *) test_bus);
109 message_func_eos (GstBus * bus, GstMessage * message, guint * p_counter)
111 const GstStructure *s;
114 g_return_val_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_EOS, FALSE);
116 GST_DEBUG ("got EOS message");
118 s = gst_message_get_structure (message);
119 if (!gst_structure_get_int (s, "msg_id", &i))
120 g_critical ("Invalid message");
122 if (p_counter != NULL)
129 message_func_app (GstBus * bus, GstMessage * message, guint * p_counter)
131 const GstStructure *s;
134 g_return_val_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_APPLICATION,
137 GST_DEBUG ("got APP message");
139 s = gst_message_get_structure (message);
140 if (!gst_structure_get_int (s, "msg_id", &i))
141 g_critical ("Invalid message");
143 if (p_counter != NULL)
150 send_messages (gpointer data)
156 for (i = 0; i < 10; i++) {
157 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
158 m = gst_message_new_application (NULL, s);
159 gst_bus_post (test_bus, m);
160 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
161 m = gst_message_new_custom (GST_MESSAGE_EOS, NULL, s);
162 gst_bus_post (test_bus, m);
168 /* test if adding a signal watch for different message types calls the
169 * respective callbacks. */
170 GST_START_TEST (test_watch)
176 test_bus = gst_bus_new ();
178 main_loop = g_main_loop_new (NULL, FALSE);
180 id = gst_bus_add_watch (test_bus, gst_bus_async_signal_func, NULL);
182 g_signal_connect (test_bus, "message::eos", (GCallback) message_func_eos,
184 g_signal_connect (test_bus, "message::application",
185 (GCallback) message_func_app, &num_app);
187 g_idle_add ((GSourceFunc) send_messages, NULL);
188 while (g_main_context_pending (NULL))
189 g_main_context_iteration (NULL, FALSE);
191 fail_unless_equals_int (num_eos, 10);
192 fail_unless_equals_int (num_app, 10);
194 fail_unless (gst_bus_remove_watch (test_bus));
195 g_main_loop_unref (main_loop);
197 gst_object_unref ((GstObject *) test_bus);
202 /* test if adding a signal watch for different message types calls the
203 * respective callbacks. */
204 GST_START_TEST (test_watch_with_custom_context)
212 test_bus = gst_bus_new ();
214 ctx = g_main_context_new ();
215 main_loop = g_main_loop_new (ctx, FALSE);
217 source = gst_bus_create_watch (test_bus);
218 g_source_set_callback (source, (GSourceFunc) gst_bus_async_signal_func, NULL,
220 id = g_source_attach (source, ctx);
221 g_source_unref (source);
224 g_signal_connect (test_bus, "message::eos", (GCallback) message_func_eos,
226 g_signal_connect (test_bus, "message::application",
227 (GCallback) message_func_app, &num_app);
229 source = g_idle_source_new ();
230 g_source_set_callback (source, (GSourceFunc) send_messages, NULL, NULL);
231 g_source_attach (source, ctx);
232 g_source_unref (source);
234 while (g_main_context_pending (ctx))
235 g_main_context_iteration (ctx, FALSE);
237 fail_unless_equals_int (num_eos, 10);
238 fail_unless_equals_int (num_app, 10);
240 if ((source = g_main_context_find_source_by_id (ctx, id)))
241 g_source_destroy (source);
242 g_main_loop_unref (main_loop);
243 g_main_context_unref (ctx);
245 gst_object_unref (test_bus);
250 /* test if adding a signal watch for different message types calls the
251 * respective callbacks. */
252 GST_START_TEST (test_add_watch_with_custom_context)
259 test_bus = gst_bus_new ();
261 ctx = g_main_context_new ();
262 main_loop = g_main_loop_new (ctx, FALSE);
264 g_main_context_push_thread_default (ctx);
265 gst_bus_add_signal_watch (test_bus);
266 g_main_context_pop_thread_default (ctx);
268 g_signal_connect (test_bus, "message::eos", (GCallback) message_func_eos,
270 g_signal_connect (test_bus, "message::application",
271 (GCallback) message_func_app, &num_app);
273 source = g_idle_source_new ();
274 g_source_set_callback (source, (GSourceFunc) send_messages, NULL, NULL);
275 g_source_attach (source, ctx);
276 g_source_unref (source);
278 while (g_main_context_pending (ctx))
279 g_main_context_iteration (ctx, FALSE);
281 fail_unless_equals_int (num_eos, 10);
282 fail_unless_equals_int (num_app, 10);
284 g_main_loop_unref (main_loop);
285 g_main_context_unref (ctx);
287 gst_object_unref (test_bus);
293 dummy_bus_func (GstBus * bus, GstMessage * msg, gpointer user_data)
298 GST_START_TEST (test_remove_watch)
300 test_bus = gst_bus_new ();
302 /* removing a non-existing watch should fail */
303 fail_if (gst_bus_remove_watch (test_bus));
305 gst_bus_add_watch (test_bus, dummy_bus_func, NULL);
307 fail_unless (gst_bus_remove_watch (test_bus));
309 /* now it should fail to remove the watch again */
310 fail_if (gst_bus_remove_watch (test_bus));
312 gst_object_unref (test_bus);
317 static gint messages_seen;
320 message_func (GstBus * bus, GstMessage * message, gpointer data)
322 g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_APPLICATION);
328 send_5app_1el_1err_2app_1eos_messages (guint interval_usecs)
334 for (i = 0; i < 5; i++) {
335 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
336 m = gst_message_new_application (NULL, s);
337 GST_LOG ("posting application message");
338 gst_bus_post (test_bus, m);
339 g_usleep (interval_usecs);
341 for (i = 0; i < 1; i++) {
342 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
343 m = gst_message_new_element (NULL, s);
344 GST_LOG ("posting element message");
345 gst_bus_post (test_bus, m);
346 g_usleep (interval_usecs);
348 for (i = 0; i < 1; i++) {
349 m = gst_message_new_error (NULL, NULL, "debug string");
350 GST_LOG ("posting error message");
351 gst_bus_post (test_bus, m);
352 g_usleep (interval_usecs);
354 for (i = 0; i < 2; i++) {
355 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
356 m = gst_message_new_application (NULL, s);
357 GST_LOG ("posting application message");
358 gst_bus_post (test_bus, m);
359 g_usleep (interval_usecs);
361 for (i = 0; i < 1; i++) {
362 m = gst_message_new_eos (NULL);
363 GST_LOG ("posting EOS message");
364 gst_bus_post (test_bus, m);
365 g_usleep (interval_usecs);
370 send_extended_messages (guint interval_usecs)
375 device = g_object_new (foo_device_get_type (), NULL);
377 msg = gst_message_new_device_added (NULL, device);
378 GST_LOG ("posting device-added message");
379 gst_bus_post (test_bus, msg);
380 g_usleep (interval_usecs);
382 msg = gst_message_new_device_removed (NULL, device);
383 GST_LOG ("posting device-removed message");
384 gst_bus_post (test_bus, msg);
385 g_usleep (interval_usecs);
387 gst_object_unref (device);
392 send_10_app_messages (void)
398 for (i = 0; i < 10; i++) {
399 s = gst_structure_new ("test_message", "msg_id", G_TYPE_INT, i, NULL);
400 m = gst_message_new_application (NULL, s);
401 gst_bus_post (test_bus, m);
405 /* test that you get the same messages from a poll as from signal watches. */
406 GST_START_TEST (test_watch_with_poll)
410 test_bus = gst_bus_new ();
413 gst_bus_add_signal_watch (test_bus);
414 g_signal_connect (test_bus, "message", (GCallback) message_func, NULL);
416 send_10_app_messages ();
418 for (i = 0; i < 10; i++)
419 gst_message_unref (gst_bus_poll (test_bus, GST_MESSAGE_APPLICATION,
420 GST_CLOCK_TIME_NONE));
422 fail_if (gst_bus_have_pending (test_bus), "unexpected messages on bus");
423 fail_unless (messages_seen == 10, "signal handler didn't get 10 messages");
425 gst_bus_remove_signal_watch (test_bus);
427 gst_object_unref (test_bus);
432 /* test that you get the messages with pop. */
433 GST_START_TEST (test_timed_pop)
437 test_bus = gst_bus_new ();
439 send_10_app_messages ();
441 for (i = 0; i < 10; i++)
442 gst_message_unref (gst_bus_timed_pop (test_bus, GST_CLOCK_TIME_NONE));
444 fail_if (gst_bus_have_pending (test_bus), "unexpected messages on bus");
446 gst_object_unref (test_bus);
457 GstDeviceClass device_klass;
460 G_DEFINE_TYPE (FooDevice, foo_device, GST_TYPE_DEVICE);
463 foo_device_class_init (FooDeviceClass * klass)
465 /* nothing to do here */
469 foo_device_init (FooDevice * device)
471 /* nothing to do here */
474 /* test that you get the messages with pop_filtered */
475 GST_START_TEST (test_timed_pop_filtered)
480 test_bus = gst_bus_new ();
482 send_10_app_messages ();
483 for (i = 0; i < 10; i++) {
484 msg = gst_bus_timed_pop_filtered (test_bus, GST_CLOCK_TIME_NONE,
486 fail_unless (msg != NULL);
487 gst_message_unref (msg);
490 /* should flush all messages on the bus with types not matching */
491 send_10_app_messages ();
492 msg = gst_bus_timed_pop_filtered (test_bus, 0,
493 GST_MESSAGE_ANY ^ GST_MESSAGE_APPLICATION);
494 fail_unless (msg == NULL);
495 msg = gst_bus_timed_pop_filtered (test_bus, GST_SECOND / 2,
496 GST_MESSAGE_ANY ^ GST_MESSAGE_APPLICATION);
497 fail_unless (msg == NULL);
498 /* there should be nothing on the bus now */
499 fail_if (gst_bus_have_pending (test_bus), "unexpected messages on bus");
500 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_ANY);
501 fail_unless (msg == NULL);
503 send_5app_1el_1err_2app_1eos_messages (0);
504 msg = gst_bus_timed_pop_filtered (test_bus, 0,
505 GST_MESSAGE_ANY ^ GST_MESSAGE_APPLICATION);
506 fail_unless (msg != NULL);
507 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_ELEMENT);
508 gst_message_unref (msg);
509 fail_unless (gst_bus_have_pending (test_bus), "expected messages on bus");
510 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_APPLICATION);
511 fail_unless (msg != NULL);
512 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_APPLICATION);
513 gst_message_unref (msg);
514 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_ERROR);
515 fail_unless (msg == NULL);
517 gst_object_unref (test_bus);
519 /* Test extended messages */
521 ("Checking extended messages received from gst_bus_timed_pop_filtered");
522 test_bus = gst_bus_new ();
524 send_5app_1el_1err_2app_1eos_messages (0);
525 send_extended_messages (0);
526 send_5app_1el_1err_2app_1eos_messages (0);
527 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_EXTENDED);
528 fail_unless (msg != NULL);
529 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_DEVICE_ADDED);
530 gst_message_unref (msg);
532 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_EXTENDED);
533 fail_unless (msg != NULL);
534 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_DEVICE_REMOVED);
535 gst_message_unref (msg);
536 gst_object_unref (test_bus);
538 /* Now check extended messages don't appear when we don't ask for them */
540 ("Checking extended messages *not* received from gst_bus_timed_pop_filtered when not wanted");
541 test_bus = gst_bus_new ();
543 send_extended_messages (0);
544 send_5app_1el_1err_2app_1eos_messages (0);
546 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_ERROR);
547 fail_unless (msg != NULL);
548 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_ERROR);
549 gst_message_unref (msg);
551 msg = gst_bus_timed_pop_filtered (test_bus, 0, GST_MESSAGE_EOS);
552 fail_unless (msg != NULL);
553 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_EOS);
554 gst_message_unref (msg);
556 gst_object_unref (test_bus);
562 post_delayed_thread (gpointer data)
565 send_5app_1el_1err_2app_1eos_messages (1 * G_USEC_PER_SEC);
569 /* test that you get the messages with pop_filtered if there's a timeout*/
570 GST_START_TEST (test_timed_pop_filtered_with_timeout)
576 test_bus = gst_bus_new ();
578 MAIN_START_THREAD_FUNCTIONS (1, post_delayed_thread, NULL);
582 msg = gst_bus_timed_pop_filtered (test_bus, 2 * GST_SECOND,
584 fail_unless (msg == NULL, "Got unexpected %s message",
585 (msg) ? GST_MESSAGE_TYPE_NAME (msg) : "");
586 msg = gst_bus_timed_pop_filtered (test_bus, (3 + 1 + 1 + 1) * GST_SECOND,
587 GST_MESSAGE_ERROR | GST_MESSAGE_ELEMENT);
588 fail_unless (msg != NULL, "expected element message, but got nothing");
589 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_ELEMENT);
590 gst_message_unref (msg);
591 msg = gst_bus_timed_pop_filtered (test_bus, GST_CLOCK_TIME_NONE,
592 GST_MESSAGE_APPLICATION);
593 fail_unless (msg != NULL, "expected application message, but got nothing");
594 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_APPLICATION);
595 gst_message_unref (msg);
596 msg = gst_bus_timed_pop_filtered (test_bus, GST_CLOCK_TIME_NONE,
597 GST_MESSAGE_APPLICATION);
598 fail_unless (msg != NULL, "expected application message, but got nothing");
599 fail_unless_equals_int (GST_MESSAGE_TYPE (msg), GST_MESSAGE_APPLICATION);
600 gst_message_unref (msg);
601 msg = gst_bus_timed_pop_filtered (test_bus, GST_SECOND / 4,
602 GST_MESSAGE_TAG | GST_MESSAGE_ERROR);
603 fail_unless (msg == NULL, "Got unexpected %s message",
604 (msg) ? GST_MESSAGE_TYPE_NAME (msg) : "");
606 MAIN_STOP_THREADS ();
608 gst_object_unref (test_bus);
613 /* test that you get the messages with pop from another thread. */
615 pop_thread (gpointer data)
617 GstBus *bus = GST_BUS_CAST (data);
620 for (i = 0; i < 10; i++)
621 gst_message_unref (gst_bus_timed_pop (bus, GST_CLOCK_TIME_NONE));
626 GST_START_TEST (test_timed_pop_thread)
629 GError *error = NULL;
631 test_bus = gst_bus_new ();
633 thread = g_thread_try_new ("gst-chek", pop_thread, test_bus, &error);
634 fail_if (error != NULL);
636 send_10_app_messages ();
638 g_thread_join (thread);
640 fail_if (gst_bus_have_pending (test_bus), "unexpected messages on bus");
642 /* try to pop a message without timeout. */
643 fail_if (gst_bus_timed_pop (test_bus, 0) != NULL);
645 /* with a small timeout */
646 fail_if (gst_bus_timed_pop (test_bus, 1000) != NULL);
648 gst_object_unref (test_bus);
654 cb_bus_call (GstBus * bus, GstMessage * msg, gpointer data)
656 GMainLoop *loop = data;
658 switch (GST_MESSAGE_TYPE (msg)) {
659 case GST_MESSAGE_EOS:
661 GST_INFO ("End-of-stream");
662 g_main_loop_quit (loop);
665 case GST_MESSAGE_ERROR:
669 gst_message_parse_error (msg, &err, NULL);
670 g_error ("Error: %s", err->message);
673 g_main_loop_quit (loop);
678 GST_LOG ("BUS MESSAGE: type=%s", GST_MESSAGE_TYPE_NAME (msg));
686 GST_START_TEST (test_custom_main_context)
690 GstElement *pipeline;
696 ctx = g_main_context_new ();
697 loop = g_main_loop_new (ctx, FALSE);
699 pipeline = gst_pipeline_new (NULL);
700 src = gst_element_factory_make ("fakesrc", NULL);
701 g_object_set (src, "num-buffers", 2000, NULL);
703 sink = gst_element_factory_make ("fakesink", NULL);
705 fail_unless (gst_bin_add (GST_BIN (pipeline), src));
706 fail_unless (gst_bin_add (GST_BIN (pipeline), sink));
707 fail_unless (gst_element_link (src, sink));
709 bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
710 source = gst_bus_create_watch (bus);
711 g_source_attach (source, ctx);
712 g_source_set_callback (source, (GSourceFunc) cb_bus_call, loop, NULL);
713 g_source_unref (source);
714 gst_object_unref (bus);
716 GST_INFO ("starting pipeline");
718 gst_element_set_state (pipeline, GST_STATE_PLAYING);
719 gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE);
721 GST_INFO ("running event loop, ctx=%p", ctx);
722 g_main_loop_run (loop);
724 gst_element_set_state (pipeline, GST_STATE_NULL);
728 g_main_context_unref (ctx);
729 g_main_loop_unref (loop);
730 gst_object_unref (pipeline);
735 static GstBusSyncReply
736 test_async_sync_handler (GstBus * bus, GstMessage * msg, gpointer user_data)
738 GArray *timestamps = user_data;
739 gint64 ts = g_get_monotonic_time () * 1000; /* microsecs -> nanosecs */
741 g_array_append_val (timestamps, ts);
742 GST_INFO ("[msg %p] %" GST_PTR_FORMAT, msg, msg);
744 return GST_BUS_ASYNC;
748 post_10_app_messages_thread (gpointer data)
751 send_10_app_messages ();
755 /* Test GST_BUS_ASYNC actually causes the thread posting the message to
756 * block until the message has been freed. We spawn a thread to post ten
757 * messages. We install a bus sync handler to get the timestamp of each
758 * message as it is being posted, and to return GST_BUS_ASYNC. In the main
759 * thread we sleep a bit after we pop off a message and before we free it.
760 * The posting thread should be blocked while the main thread sleeps, so
761 * we expect the interval as the messages are posted to be roughly the same
762 * as the sleep time in the main thread. g_usleep() is not super-precise, so
763 * we allow for some slack there, we just want to check that the posting
764 * thread was blocked at all really. */
765 GST_START_TEST (test_async_message)
772 timestamps = g_array_sized_new (FALSE, FALSE, sizeof (gint64), 10);
774 test_bus = gst_bus_new ();
776 gst_bus_set_sync_handler (test_bus, test_async_sync_handler, timestamps,
779 MAIN_START_THREAD_FUNCTIONS (1, post_10_app_messages_thread, NULL);
783 for (i = 0; i < 10; i++) {
786 GST_LOG ("(%d) waiting for message..", i);
787 msg = gst_bus_timed_pop (test_bus, GST_CLOCK_TIME_NONE);
788 GST_LOG ("(%d) got message, sleeping a bit", i);
789 g_usleep (60 * GST_MSECOND / (GST_SECOND / G_USEC_PER_SEC));
790 GST_LOG ("(%d) about to free message", i);
791 gst_message_unref (msg);
794 for (i = 1; i < 10; i++) {
795 gint64 prev_ts = g_array_index (timestamps, gint64, i - 1);
796 gint64 ts = g_array_index (timestamps, gint64, i);
797 gint64 diff = ts - prev_ts;
799 fail_unless (prev_ts < ts);
800 fail_unless (diff >= 20 * GST_MSECOND, "interval between messages being "
801 "posted was just %" G_GINT64_FORMAT "ms", diff / GST_MSECOND);
804 fail_if (gst_bus_have_pending (test_bus), "unexpected messages on bus");
806 MAIN_STOP_THREADS ();
808 gst_object_unref (test_bus);
810 g_array_unref (timestamps);
818 Suite *s = suite_create ("GstBus");
819 TCase *tc_chain = tcase_create ("stresstest");
821 tcase_set_timeout (tc_chain, 60);
823 suite_add_tcase (s, tc_chain);
824 tcase_add_test (tc_chain, test_hammer_bus);
825 tcase_add_test (tc_chain, test_watch);
826 tcase_add_test (tc_chain, test_watch_with_poll);
827 tcase_add_test (tc_chain, test_watch_with_custom_context);
828 tcase_add_test (tc_chain, test_add_watch_with_custom_context);
829 tcase_add_test (tc_chain, test_remove_watch);
830 tcase_add_test (tc_chain, test_timed_pop);
831 tcase_add_test (tc_chain, test_timed_pop_thread);
832 tcase_add_test (tc_chain, test_timed_pop_filtered);
833 tcase_add_test (tc_chain, test_timed_pop_filtered_with_timeout);
834 tcase_add_test (tc_chain, test_custom_main_context);
835 tcase_add_test (tc_chain, test_async_message);
839 GST_CHECK_MAIN (gst_bus);