Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / tests / check / elements / rtpsink.c
1 /* GStreamer
2  * Copyright (C) <2018> Marc Leeman <marc.leeman@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #include <gst/check/gstcheck.h>
21
22 GST_START_TEST (test_uri_to_properties)
23 {
24   GstElement *rtpsink;
25
26   gint ttl, ttl_mc;
27
28   rtpsink = gst_element_factory_make ("rtpsink", NULL);
29
30   /* Sets properties to non-default values (make sure this stays in sync) */
31   g_object_set (rtpsink, "uri", "rtp://1.230.1.2:1234?" "ttl=8" "&ttl-mc=9",
32       NULL);
33
34   g_object_get (rtpsink, "ttl", &ttl, "ttl_mc", &ttl_mc, NULL);
35
36   /* Make sure these values are in sync with the one from the URI. */
37   g_assert_cmpint (ttl, ==, 8);
38   g_assert_cmpint (ttl_mc, ==, 9);
39
40   gst_object_unref (rtpsink);
41 }
42
43 GST_END_TEST;
44
45 static Suite *
46 rtpsink_suite (void)
47 {
48   Suite *s = suite_create ("rtpsink");
49   TCase *tc_chain = tcase_create ("general");
50
51   suite_add_tcase (s, tc_chain);
52   tcase_add_test (tc_chain, test_uri_to_properties);
53
54   return s;
55 }
56
57 GST_CHECK_MAIN (rtpsink);