Commit 5de913c2 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

tests/check/elements/subparse.c: Add unit test for MPL2 subtitle format (#413799).

Original commit message from CVS:
* tests/check/elements/subparse.c: (GST_START_TEST),
(subparse_suite):
Add unit test for MPL2 subtitle format (#413799).
parent 389eb6f2
2007-03-10 Tim-Philipp Müller <tim at centricular dot net>
* tests/check/elements/subparse.c: (GST_START_TEST),
(subparse_suite):
Add unit test for MPL2 subtitle format (#413799).
2007-03-10 Tim-Philipp Müller <tim at centricular dot net> 2007-03-10 Tim-Philipp Müller <tim at centricular dot net>
   
Patch by: Kamil Pawlowski <kamilpe gmail com> Patch by: Kamil Pawlowski <kamilpe gmail com>
...@@ -433,6 +433,32 @@ GST_START_TEST (test_microdvd_with_fps) ...@@ -433,6 +433,32 @@ GST_START_TEST (test_microdvd_with_fps)
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_mpl2)
{
SubParseInputChunk mpl2_input[] = {
{
"[123][456] This is the Earth at a time|when the dinosaurs roamed\n",
(123 * GST_SECOND) / 10, (456 * GST_SECOND) / 10,
"This is the Earth at a time\nwhen the dinosaurs roamed"}, {
"[1234][5678]a lush and fertile planet.\n",
(1234 * GST_SECOND) / 10, (5678 * GST_SECOND) / 10,
"a lush and fertile planet."}, {
"[12345][27890] /Italic|Normal\n",
(12345 * GST_SECOND) / 10, (27890 * GST_SECOND) / 10,
"<i>Italic</i>\nNormal"}, {
"[32345][37890]/Italic|/Italic\n",
(32345 * GST_SECOND) / 10, (37890 * GST_SECOND) / 10,
"<i>Italic</i>\n<i>Italic</i>"}, {
"[42345][47890] Normal|/Italic",
(42345 * GST_SECOND) / 10, (47890 * GST_SECOND) / 10,
"Normal\n<i>Italic</i>"}
};
do_test (mpl2_input, G_N_ELEMENTS (mpl2_input), "text/x-pango-markup");
}
GST_END_TEST;
/* TODO: /* TODO:
* - add/modify tests so that lines aren't dogfed to the parsers in complete * - add/modify tests so that lines aren't dogfed to the parsers in complete
* lines or sets of complete lines, but rather in random chunks * lines or sets of complete lines, but rather in random chunks
...@@ -455,6 +481,7 @@ subparse_suite (void) ...@@ -455,6 +481,7 @@ subparse_suite (void)
tcase_add_test (tc_chain, test_tmplayer_style4); tcase_add_test (tc_chain, test_tmplayer_style4);
tcase_add_test (tc_chain, test_tmplayer_style4_with_bogus_lines); tcase_add_test (tc_chain, test_tmplayer_style4_with_bogus_lines);
tcase_add_test (tc_chain, test_microdvd_with_fps); tcase_add_test (tc_chain, test_microdvd_with_fps);
tcase_add_test (tc_chain, test_mpl2);
return s; return s;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment