tests/check/: use the new macro
[platform/upstream/gstreamer.git] / tests / check / gst / gst.c
1 /* GStreamer
2  * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
3  *
4  * gst.c: Unit test for gst.c
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 #include <gst/check/gstcheck.h>
23
24 GST_START_TEST (test_init)
25 {
26   /* don't segfault with NULL, NULL */
27   gst_init (NULL, NULL);
28   /* allow calling twice. well, actually, thrice. */
29   gst_init (NULL, NULL);
30 }
31
32 GST_END_TEST;
33
34 GST_START_TEST (test_deinit)
35 {
36   gst_init (NULL, NULL);
37
38   gst_deinit ();
39 }
40
41 GST_END_TEST;
42
43 GST_START_TEST (test_deinit_sysclock)
44 {
45   GstClock *clock;
46
47   gst_init (NULL, NULL);
48
49   clock = gst_system_clock_obtain ();
50   gst_object_unref (clock);
51
52   gst_deinit ();
53 }
54
55 GST_END_TEST;
56
57 /* tests if we can create an element from a compiled-in plugin */
58 GST_START_TEST (test_new_pipeline)
59 {
60   GstElement *pipeline;
61
62   pipeline = gst_pipeline_new ("pipeline");
63   gst_object_unref (pipeline);
64 }
65
66 GST_END_TEST;
67
68 /* tests if we can load an element from a plugin */
69 GST_START_TEST (test_new_fakesrc)
70 {
71   GstElement *element;
72
73   element = gst_element_factory_make ("fakesrc", NULL);
74   gst_object_unref (element);
75 }
76
77 GST_END_TEST;
78
79
80 Suite *
81 gst_suite (void)
82 {
83   Suite *s = suite_create ("Gst");
84   TCase *tc_chain = tcase_create ("gst tests");
85
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);
92
93   return s;
94 }
95
96 GST_CHECK_MAIN (gst);