1 /* GStreamer unit tests for discoverer
3 * Copyright (C) 2011 Stefan Kost <ensonic@users.sf.net>
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.
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.
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.
25 #include <gst/check/gstcheck.h>
26 #include <gst/pbutils/pbutils.h>
29 #include <glib/gstdio.h>
30 #include <glib/gprintf.h>
33 GST_START_TEST (test_disco_init)
38 dc = gst_discoverer_new (GST_SECOND, &err);
39 fail_unless (dc != NULL);
40 fail_unless (err == NULL);
47 GST_START_TEST (test_disco_sync)
51 GstDiscovererInfo *info;
52 GstDiscovererResult result;
55 dc = gst_discoverer_new (GST_SECOND, &err);
56 fail_unless (dc != NULL);
57 fail_unless (err == NULL);
59 /* GST_TEST_FILE comes from makefile CFLAGS */
60 GST_INFO ("discovering file '%s'", GST_TEST_FILE);
61 uri = g_filename_to_uri (GST_TEST_FILE, NULL, &err);
62 fail_unless (err == NULL);
63 GST_INFO ("discovering uri '%s'", uri);
65 info = gst_discoverer_discover_uri (dc, uri, &err);
66 result = gst_discoverer_info_get_result (info);
67 GST_INFO ("result: %d", result);
68 gst_discoverer_info_unref (info);
72 /* we won't have the codec for the jpeg */
83 discoverer_suite (void)
85 Suite *s = suite_create ("discoverer");
86 TCase *tc_chain = tcase_create ("general");
88 suite_add_tcase (s, tc_chain);
89 tcase_add_test (tc_chain, test_disco_init);
90 tcase_add_test (tc_chain, test_disco_sync);
94 GST_CHECK_MAIN (discoverer);