diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2014-06-24 10:47:33 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-06-24 10:48:39 +0100 |
commit | f7aeb57858aa20757076aa2680cf1f780bf047ef (patch) | |
tree | 6b978f039ffa7ed442fa4b6f3dda96fa927c948b | |
parent | 495dfe3c5b2d02af0cbd1dcf99950ffaeac7afef (diff) |
tests: add udpsink test to check client add/remove
-rw-r--r-- | tests/check/elements/udpsink.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/check/elements/udpsink.c b/tests/check/elements/udpsink.c index 4dcc5051a..0e938eef1 100644 --- a/tests/check/elements/udpsink.c +++ b/tests/check/elements/udpsink.c @@ -155,6 +155,55 @@ GST_START_TEST (test_udpsink_bufferlist) GST_END_TEST; +GST_START_TEST (test_udpsink_client_add_remove) +{ + GstElement *udpsink; + + /* Note: keep in mind that these are in addition to the client added by + * the host/port properties (by default 'localhost:5004' */ + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "remove", "localhost", 5004, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "remove", "127.0.0.1", 5554, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "remove", "127.0.0.1", 5555, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5555, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "add", "10.2.0.1", 5554, NULL); + gst_object_unref (udpsink); + + udpsink = gst_check_setup_element ("udpsink"); + g_signal_emit_by_name (udpsink, "add", "127.0.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "add", "10.2.0.1", 5554, NULL); + g_signal_emit_by_name (udpsink, "remove", "127.0.0.1", 5554, NULL); + gst_object_unref (udpsink); +} + +GST_END_TEST; + static Suite * udpsink_suite (void) { @@ -165,6 +214,7 @@ udpsink_suite (void) tcase_add_test (tc_chain, test_udpsink); tcase_add_test (tc_chain, test_udpsink_bufferlist); + tcase_add_test (tc_chain, test_udpsink_client_add_remove); return s; } |