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., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
25 #include <gst/check/gstcheck.h>
26 #include <gst/gstversion.h>
28 GST_START_TEST (test_init)
30 /* don't segfault with NULL, NULL */
31 gst_init (NULL, NULL);
32 /* allow calling twice. well, actually, thrice. */
33 gst_init (NULL, NULL);
38 GST_START_TEST (test_deinit)
40 gst_init (NULL, NULL);
47 GST_START_TEST (test_deinit_sysclock)
51 gst_init (NULL, NULL);
53 clock = gst_system_clock_obtain ();
54 gst_object_unref (clock);
61 /* tests if we can create an element from a compiled-in plugin */
62 GST_START_TEST (test_new_pipeline)
66 pipeline = gst_pipeline_new ("pipeline");
67 gst_object_unref (pipeline);
72 /* tests if we can load an element from a plugin */
73 GST_START_TEST (test_new_fakesrc)
77 element = gst_element_factory_make ("fakesrc", NULL);
78 gst_object_unref (element);
83 GST_START_TEST (test_version)
85 guint major, minor, micro, nano;
88 gst_version (&major, &minor, µ, &nano);
89 assert_equals_int (major, GST_VERSION_MAJOR);
91 version = gst_version_string ();
92 fail_if (version == NULL);
101 Suite *s = suite_create ("Gst");
102 TCase *tc_chain = tcase_create ("gst tests");
104 suite_add_tcase (s, tc_chain);
105 tcase_add_test (tc_chain, test_init);
106 tcase_add_test (tc_chain, test_new_pipeline);
107 tcase_add_test (tc_chain, test_new_fakesrc);
108 tcase_add_test (tc_chain, test_version);
109 /* run these last so the others don't fail if CK_FORK=no is being used */
110 tcase_add_test (tc_chain, test_deinit_sysclock);
111 tcase_add_test (tc_chain, test_deinit);
116 GST_CHECK_MAIN (gst);