summaryrefslogtreecommitdiff
path: root/tests/check/elements/subparse.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2013-11-21 16:34:25 +0000
committerTim-Philipp Müller <tim@centricular.com>2013-11-21 16:34:25 +0000
commit60e87090eb1f91e298f4e1005a6f6953b592709f (patch)
treeee4c226c8c3f4a18be94c3a253438ba46bc3362c /tests/check/elements/subparse.c
parenta81b2380cfcb3dc97eca08318b1b405e477ec8f1 (diff)
tests: add unit test for samiparser issue
https://bugzilla.gnome.org/show_bug.cgi?id=712805
Diffstat (limited to 'tests/check/elements/subparse.c')
-rw-r--r--tests/check/elements/subparse.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/check/elements/subparse.c b/tests/check/elements/subparse.c
index 0651eabd5..3bc56d5c5 100644
--- a/tests/check/elements/subparse.c
+++ b/tests/check/elements/subparse.c
@@ -771,6 +771,32 @@ GST_START_TEST (test_sami_bad_entities)
GST_END_TEST;
+GST_START_TEST (test_sami_comment)
+{
+ SubParseInputChunk sami_input[] = {
+ {"<SAMI>\n"
+ "<!--\n"
+ "=======\n"
+ "foo bar\n"
+ "=======\n"
+ "-->\n"
+ "<BODY>\n"
+ " <SYNC Start=1000>\n"
+ " <P Class=\"C====\">\n" " &nbsp &\n",
+ 1000 * GST_MSECOND, 2000 * GST_MSECOND,
+ "\xc2\xa0 &amp;"},
+ {" <SYNC Start=2000>\n"
+ " <P Class=CC>\n"
+ " &#xa0 &#177 &#180;\n" "</BODY>\n" "</SAMI>\n",
+ 2000 * GST_MSECOND, GST_CLOCK_TIME_NONE,
+ "\xc2\xa0 \xc2\xb1 \xc2\xb4"}
+ };
+
+ do_test (sami_input, G_N_ELEMENTS (sami_input), "pango-markup");
+}
+
+GST_END_TEST;
+
/* TODO:
* - 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
@@ -803,6 +829,7 @@ subparse_suite (void)
tcase_add_test (tc_chain, test_sami_xml_entities);
tcase_add_test (tc_chain, test_sami_html_entities);
tcase_add_test (tc_chain, test_sami_bad_entities);
+ tcase_add_test (tc_chain, test_sami_comment);
return s;
}