diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-14 09:05:13 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-14 09:05:13 +0000 |
| commit | b0a9bc81744440404d68bcbdc8bda925a8a64597 (patch) | |
| tree | 0861022624056676003c0ecc292e7bb0d79f08ef /test | |
| parent | 287d8bb5eb247e8746718a919091fff09b0b624d (diff) | |
Fix subtitle parser to cope with
<Text>Hello this is some <Font italic="yes">italic</Font> text</Text>.
The data structures are unable to cope, so hack it to use
Pango markup in those cases (formatting changes during a line).
Diffstat (limited to 'test')
| -rw-r--r-- | test/subtitle_tests.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/subtitle_tests.cc b/test/subtitle_tests.cc index 835ae960..d1b2795f 100644 --- a/test/subtitle_tests.cc +++ b/test/subtitle_tests.cc @@ -444,6 +444,29 @@ BOOST_AUTO_TEST_CASE (subtitles3) libdcp::Time (0, 0, 0, 0, 25), libdcp::Time (0, 0, 0, 0, 25) )); +} +/* <Font italic="yes"> in the middle of a string */ +BOOST_AUTO_TEST_CASE (subtitles4) +{ + libdcp::SubtitleAsset subs ("test/data", "subs4.xml"); + list<shared_ptr<libdcp::Subtitle> > s = subs.subtitles_during (libdcp::Time (0, 0, 0, 0, 25), libdcp::Time (0, 0, 7, 0, 25)); + + BOOST_REQUIRE_EQUAL (s.size(), 1); + BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + "", + false, + libdcp::Color (255, 255, 255), + 42, + libdcp::Time (0, 0, 4, 21, 25), + libdcp::Time (0, 0, 6, 5, 25), + 8, + libdcp::BOTTOM, + "Hello <i>there</i> world", + libdcp::BORDER, + libdcp::Color (0, 0, 0), + libdcp::Time (0, 0, 0, 0, 25), + libdcp::Time (0, 0, 0, 0, 25) + )); } |
