2 * Copyright (C) 2009 Stefan Kost <ensonic@users.sf.net>
4 * gstchildproxy.c: Unit test for GstChildProxy interface
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #include <gst/check/gstcheck.h>
24 GST_START_TEST (test_get)
29 pipeline = gst_pipeline_new ("foo");
30 fail_unless (pipeline != NULL, "Could not create pipeline");
32 gst_child_proxy_get (GST_OBJECT (pipeline), "name", &name, NULL);
33 fail_if (g_strcmp0 ("foo", name));
36 gst_object_unref (pipeline);
41 GST_START_TEST (test_child_get)
43 GstElement *pipeline, *elem;
46 pipeline = gst_pipeline_new (NULL);
47 fail_unless (pipeline != NULL, "Could not create pipeline");
49 elem = gst_element_factory_make ("fakesrc", "src");
50 fail_if (elem == NULL, "Could not create fakesrc");
52 gst_bin_add (GST_BIN (pipeline), elem);
54 gst_child_proxy_get (GST_OBJECT (pipeline), "src::name", &name, NULL);
55 fail_if (g_strcmp0 ("src", name));
58 gst_object_unref (pipeline);
65 gst_child_proxy_suite (void)
67 Suite *s = suite_create ("GstChildProxy");
68 TCase *tc_chain = tcase_create ("child proxy tests");
70 tcase_set_timeout (tc_chain, 0);
72 suite_add_tcase (s, tc_chain);
73 tcase_add_test (tc_chain, test_get);
74 tcase_add_test (tc_chain, test_child_get);
79 GST_CHECK_MAIN (gst_child_proxy);