commit a file I forgot
[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 "../gstcheck.h"
23
24 START_TEST (test_init)
25 {
26   /* don't segfault with NULL, NULL */
27   gst_init (NULL, NULL);
28   /* allow calling twice */
29   gst_init (NULL, NULL);
30 }
31
32 END_TEST;
33
34 Suite *
35 gst_suite (void)
36 {
37   Suite *s = suite_create ("Gst");
38   TCase *tc_chain = tcase_create ("gst tests");
39
40   suite_add_tcase (s, tc_chain);
41   tcase_add_test (tc_chain, test_init);
42
43   return s;
44 }
45
46 int
47 main (int argc, char **argv)
48 {
49   int nf;
50
51   Suite *s = gst_suite ();
52   SRunner *sr = srunner_create (s);
53
54   gst_check_init (&argc, &argv);
55
56   srunner_run_all (sr, CK_NORMAL);
57   nf = srunner_ntests_failed (sr);
58   srunner_free (sr);
59
60   return nf;
61 }