From b0a9bc81744440404d68bcbdc8bda925a8a64597 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 14 Jan 2015 09:05:13 +0000 Subject: Fix subtitle parser to cope with Hello this is some italic text. The data structures are unable to cope, so hack it to use Pango markup in those cases (formatting changes during a line). --- test/subtitle_tests.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') 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) )); +} +/* in the middle of a string */ +BOOST_AUTO_TEST_CASE (subtitles4) +{ + libdcp::SubtitleAsset subs ("test/data", "subs4.xml"); + list > 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 there world", + libdcp::BORDER, + libdcp::Color (0, 0, 0), + libdcp::Time (0, 0, 0, 0, 25), + libdcp::Time (0, 0, 0, 0, 25) + )); } -- cgit v1.2.3