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>
23 #include <gst/gstversion.h>
25 GST_START_TEST (test_init)
27 /* don't segfault with NULL, NULL */
28 gst_init (NULL, NULL);
29 /* allow calling twice. well, actually, thrice. */
30 gst_init (NULL, NULL);
35 GST_START_TEST (test_deinit)
37 gst_init (NULL, NULL);
44 GST_START_TEST (test_deinit_sysclock)
48 gst_init (NULL, NULL);
50 clock = gst_system_clock_obtain ();
51 gst_object_unref (clock);
58 /* tests if we can create an element from a compiled-in plugin */
59 GST_START_TEST (test_new_pipeline)
63 pipeline = gst_pipeline_new ("pipeline");
64 gst_object_unref (pipeline);
69 /* tests if we can load an element from a plugin */
70 GST_START_TEST (test_new_fakesrc)
74 element = gst_element_factory_make ("fakesrc", NULL);
75 gst_object_unref (element);
80 GST_START_TEST (test_version)
82 guint major, minor, micro, nano;
85 gst_version (&major, &minor, µ, &nano);
86 assert_equals_int (major, GST_VERSION_MAJOR);
88 version = gst_version_string ();
89 fail_if (version == NULL);
98 Suite *s = suite_create ("Gst");
99 TCase *tc_chain = tcase_create ("gst tests");
101 suite_add_tcase (s, tc_chain);
102 tcase_add_test (tc_chain, test_init);
103 tcase_add_test (tc_chain, test_new_pipeline);
104 tcase_add_test (tc_chain, test_new_fakesrc);
105 tcase_add_test (tc_chain, test_version);
106 /* run these last so the others don't fail if CK_FORK=no is being used */
107 tcase_add_test (tc_chain, test_deinit_sysclock);
108 tcase_add_test (tc_chain, test_deinit);
113 GST_CHECK_MAIN (gst);