mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
subparse: add typefind tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6937>
This commit is contained in:
parent
e2b1730398
commit
f7c8f4bb26
2 changed files with 30 additions and 0 deletions
|
@ -508,6 +508,19 @@ GST_START_TEST (test_webvtt)
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_subparse)
|
||||||
|
{
|
||||||
|
const gchar *type;
|
||||||
|
GstCaps *caps = NULL;
|
||||||
|
|
||||||
|
caps = typefind_test_file ("subrip.srt");
|
||||||
|
type = gst_structure_get_name (gst_caps_get_structure (caps, 0));
|
||||||
|
fail_unless_equals_string (type, "application/x-subtitle");
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
static Suite *
|
static Suite *
|
||||||
typefindfunctions_suite (void)
|
typefindfunctions_suite (void)
|
||||||
{
|
{
|
||||||
|
@ -526,6 +539,7 @@ typefindfunctions_suite (void)
|
||||||
tcase_add_test (tc_chain, test_hls_m3u8);
|
tcase_add_test (tc_chain, test_hls_m3u8);
|
||||||
tcase_add_test (tc_chain, test_manifest_typefinding);
|
tcase_add_test (tc_chain, test_manifest_typefinding);
|
||||||
tcase_add_test (tc_chain, test_webvtt);
|
tcase_add_test (tc_chain, test_webvtt);
|
||||||
|
tcase_add_test (tc_chain, test_subparse);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
16
subprojects/gst-plugins-base/tests/files/subrip.srt
Normal file
16
subprojects/gst-plugins-base/tests/files/subrip.srt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
1
|
||||||
|
00:00:01,000 --> 00:00:02,000
|
||||||
|
One
|
||||||
|
|
||||||
|
2
|
||||||
|
00:00:02,000 --> 00:00:03,000
|
||||||
|
Two
|
||||||
|
|
||||||
|
3
|
||||||
|
00:00:03,000 --> 00:00:04,000
|
||||||
|
Three
|
||||||
|
|
||||||
|
4
|
||||||
|
00:00:04,000 --> 00:00:05,000
|
||||||
|
Four
|
||||||
|
|
Loading…
Reference in a new issue