2 * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
4 * gst.c: Unit test for gst.c
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_init)
26 /* don't segfault with NULL, NULL */
27 gst_init (NULL, NULL);
28 /* allow calling twice. well, actually, thrice. */
29 gst_init (NULL, NULL);
34 GST_START_TEST (test_deinit)
36 gst_init (NULL, NULL);
43 GST_START_TEST (test_deinit_sysclock)
47 gst_init (NULL, NULL);
49 clock = gst_system_clock_obtain ();
50 gst_object_unref (clock);
57 /* tests if we can create an element from a compiled-in plugin */
58 GST_START_TEST (test_new_pipeline)
62 pipeline = gst_pipeline_new ("pipeline");
63 gst_object_unref (pipeline);
68 /* tests if we can load an element from a plugin */
69 GST_START_TEST (test_new_fakesrc)
73 element = gst_element_factory_make ("fakesrc", NULL);
74 gst_object_unref (element);
83 Suite *s = suite_create ("Gst");
84 TCase *tc_chain = tcase_create ("gst tests");
86 suite_add_tcase (s, tc_chain);
87 tcase_add_test (tc_chain, test_init);
88 tcase_add_test (tc_chain, test_deinit);
89 tcase_add_test (tc_chain, test_deinit_sysclock);
90 tcase_add_test (tc_chain, test_new_pipeline);
91 tcase_add_test (tc_chain, test_new_fakesrc);