d54d9f40358951dded0692f8cac7eb3e3ca1ff10
[platform/upstream/gstreamer.git] / tests / check / gst / gsturi.c
1 /* GStreamer unit tests for GstURI
2  *
3  * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #include <gst/check/gstcheck.h>
22
23 GST_START_TEST (test_protocol_case)
24 {
25   GstElement *element;
26
27   element = gst_element_make_from_uri (GST_URI_SRC, "file:///foo/bar", NULL);
28
29   /* no element? probably no registry, bail out */
30   if (element == NULL)
31     return;
32
33   gst_object_unref (element);
34   element = gst_element_make_from_uri (GST_URI_SRC, "FILE:///foo/bar", NULL);
35   fail_unless (element != NULL,
36       "Got source for 'file://' URI but not for 'FILE://' URI");
37   gst_object_unref (element);
38 }
39
40 GST_END_TEST;
41
42 static Suite *
43 gst_uri_suite (void)
44 {
45   Suite *s = suite_create ("GstURI");
46   TCase *tc_chain = tcase_create ("uri");
47
48   tcase_set_timeout (tc_chain, 20);
49
50   suite_add_tcase (s, tc_chain);
51   tcase_add_test (tc_chain, test_protocol_case);
52   return s;
53 }
54
55 GST_CHECK_MAIN (gst_uri);