diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-11-08 10:59:22 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-11-08 10:59:22 +0000 |
| commit | de004ef24e078906f656cbf4cc790bbfe11ea69c (patch) | |
| tree | f5b86576430275975ad9d8223159e09aeecb6c38 /test | |
| parent | e3e94b79925f085c7176ea85a396c0a56714f56d (diff) | |
Various fixes to subtitle rendering.
Use <span> to mark text up for Pango as this can set up everything,
and is easier than using <b>..</b> etc. Fix the estimation of subtitle
area size to cope with different subtitle sizes. Use show_in_cairo_context
rather than add_to_cairo_context so that colours in the markup are
respected.
Diffstat (limited to 'test')
| -rw-r--r-- | test/render_subtitles_test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 91aafb072..68b819689 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test1) { std::list<SubtitleString> s; add (s, "Hello", false, false, false); - BOOST_CHECK_EQUAL (marked_up (s), "Hello"); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "Hello"); } /** Test marked_up() in render_subtitles.cc */ @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test2) { std::list<SubtitleString> s; add (s, "Hello", false, true, false); - BOOST_CHECK_EQUAL (marked_up (s), "<b>Hello</b>"); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "<b>Hello</b>"); } @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test3) { std::list<SubtitleString> s; add (s, "Hello", true, true, false); - BOOST_CHECK_EQUAL (marked_up (s), "<i><b>Hello</b></i>"); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "<i><b>Hello</b></i>"); } /** Test marked_up() in render_subtitles.cc */ @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test4) { std::list<SubtitleString> s; add (s, "Hello", true, true, true); - BOOST_CHECK_EQUAL (marked_up (s), "<i><b><u>Hello</u></b></i>"); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "<i><b><u>Hello</u></b></i>"); } /** Test marked_up() in render_subtitles.cc */ @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE (render_markup_test5) std::list<SubtitleString> s; add (s, "Hello", false, true, false); add (s, " world.", false, false, false); - BOOST_CHECK_EQUAL (marked_up (s), "<b>Hello</b> world."); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "<b>Hello</b> world."); } /** Test marked_up() in render_subtitles.cc */ @@ -101,5 +101,5 @@ BOOST_AUTO_TEST_CASE (render_markup_test6) add (s, "Hello", true, false, false); add (s, " world ", false, false, false); add (s, "we are bold.", false, true, false); - BOOST_CHECK_EQUAL (marked_up (s), "<i>Hello</i> world <b>we are bold.</b>"); + BOOST_CHECK_EQUAL (marked_up (s, 1024), "<i>Hello</i> world <b>we are bold.</b>"); } |
