X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Frender_subtitles_test.cc;h=29c6c9963575b949c29bcbe8012aa4ff8c1f0e54;hp=9ab4f5debd8bb7084ae6ee3de751886cc6825b9c;hb=d0555983d175e76585b2409d982e09f444eab391;hpb=59f07d959514b80fcce5aa99f575ef8e6fceba8b diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 9ab4f5deb..29c6c9963 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -18,86 +18,94 @@ */ -#include "lib/render_subtitles.h" +/** @file test/render_text_test.cc + * @brief Check markup of subtitles for rendering. + * @ingroup specific + */ + +#include "lib/render_text.h" #include #include static void -add (std::list& s, std::string text, bool italic, bool bold, bool underline) +add (std::list& s, std::string text, bool italic, bool bold, bool underline) { s.push_back ( - dcp::SubtitleString ( - boost::optional (), - italic, - bold, - underline, - dcp::Colour (255, 255, 255), - 42, - 1, - dcp::Time (), - dcp::Time (), - 1, - dcp::HALIGN_LEFT, - 1, - dcp::VALIGN_TOP, - dcp::DIRECTION_LTR, - text, - dcp::NONE, - dcp::Colour (0, 0, 0), - dcp::Time (), - dcp::Time () + StringText ( + dcp::SubtitleString ( + boost::optional (), + italic, + bold, + underline, + dcp::Colour (255, 255, 255), + 42, + 1, + dcp::Time (), + dcp::Time (), + 1, + dcp::HALIGN_LEFT, + 1, + dcp::VALIGN_TOP, + dcp::DIRECTION_LTR, + text, + dcp::NONE, + dcp::Colour (0, 0, 0), + dcp::Time (), + dcp::Time () + ), + 2 ) ); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test1) { - std::list s; + std::list s; add (s, "Hello", false, false, false); - BOOST_CHECK_EQUAL (marked_up (s), "Hello"); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test2) { - std::list s; + std::list s; add (s, "Hello", false, true, false); - BOOST_CHECK_EQUAL (marked_up (s), "Hello"); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test3) { - std::list s; + std::list s; add (s, "Hello", true, true, false); - BOOST_CHECK_EQUAL (marked_up (s), "Hello"); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test4) { - std::list s; + std::list s; add (s, "Hello", true, true, true); - BOOST_CHECK_EQUAL (marked_up (s), "Hello"); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello"); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test5) { - std::list s; + std::list s; add (s, "Hello", false, true, false); add (s, " world.", false, false, false); - BOOST_CHECK_EQUAL (marked_up (s), "Hello world."); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello world."); } -/** Test marked_up() in render_subtitles.cc */ +/** Test marked_up() in render_text.cc */ BOOST_AUTO_TEST_CASE (render_markup_test6) { - std::list s; + std::list s; 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), "Hello world we are bold."); + BOOST_CHECK_EQUAL (marked_up (s, 1024, 1), "Hello world we are bold."); }