tests: add typefind test for application/x-hls
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 30 Mar 2011 14:47:38 +0000 (15:47 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 30 Mar 2011 14:47:38 +0000 (15:47 +0100)
To make sure we don't break detection when we add typefinding
for normal m3u8 playlists.

tests/check/gst/typefindfunctions.c
tests/files/Makefile.am
tests/files/hls.m3u8 [new file with mode: 0644]

index cbe188a..c53c671 100644 (file)
@@ -354,6 +354,20 @@ GST_START_TEST (test_random_data)
 
 GST_END_TEST;
 
+GST_START_TEST (test_hls_m3u8)
+{
+  const gchar *type;
+  GstCaps *caps = NULL;
+
+  caps = typefind_test_file ("hls.m3u8");
+  type = gst_structure_get_name (gst_caps_get_structure (caps, 0));
+  fail_unless_equals_string (type, "application/x-hls");
+
+  gst_caps_unref (caps);
+}
+
+GST_END_TEST;
+
 static Suite *
 typefindfunctions_suite (void)
 {
@@ -369,6 +383,7 @@ typefindfunctions_suite (void)
   tcase_add_test (tc_chain, test_ac3);
   tcase_add_test (tc_chain, test_eac3);
   tcase_add_test (tc_chain, test_random_data);
+  tcase_add_test (tc_chain, test_hls_m3u8);
 
   return s;
 }
index fb3bba5..ca997a2 100644 (file)
@@ -1,3 +1,4 @@
 EXTRA_DIST = \
        623663.mts \
+       hls.m3u8 \
        partialframe.mjpeg
diff --git a/tests/files/hls.m3u8 b/tests/files/hls.m3u8
new file mode 100644 (file)
index 0000000..3acce06
--- /dev/null
@@ -0,0 +1,15 @@
+#EXTM3U
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=246221
+0240/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=38872
+0064/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=153059
+0150/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=455394
+0440/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=650356
+0640/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=861738
+0840/prog_index.m3u8
+#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1258987
+1240/prog_index.m3u8