projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Listen for server replies on different ports on main and batch, and get servers to...
[dcpomatic.git]
/
test
/
render_subtitles_test.cc
diff --git
a/test/render_subtitles_test.cc
b/test/render_subtitles_test.cc
index 68b819689103e0476b6e0a0cddc0b449f7dc7e4a..4276a2b01e58ae155a595a5f223bcb3303484001 100644
(file)
--- a/
test/render_subtitles_test.cc
+++ b/
test/render_subtitles_test.cc
@@
-18,6
+18,11
@@
*/
*/
+/** @file test/render_subtitles_test.cc
+ * @brief Check markup of subtitles for rendering.
+ * @ingroup specific
+ */
+
#include "lib/render_subtitles.h"
#include <dcp/subtitle_string.h>
#include <boost/test/unit_test.hpp>
#include "lib/render_subtitles.h"
#include <dcp/subtitle_string.h>
#include <boost/test/unit_test.hpp>
@@
-57,7
+62,7
@@
BOOST_AUTO_TEST_CASE (render_markup_test1)
{
std::list<SubtitleString> s;
add (s, "Hello", false, false, false);
{
std::list<SubtitleString> s;
add (s, "Hello", false, false, false);
- BOOST_CHECK_EQUAL (marked_up (s, 1024
), "Hello
");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>
");
}
/** Test marked_up() in render_subtitles.cc */
}
/** Test marked_up() in render_subtitles.cc */
@@
-65,7
+70,7
@@
BOOST_AUTO_TEST_CASE (render_markup_test2)
{
std::list<SubtitleString> s;
add (s, "Hello", false, true, false);
{
std::list<SubtitleString> s;
add (s, "Hello", false, true, false);
- BOOST_CHECK_EQUAL (marked_up (s, 1024
), "<b>Hello</b
>");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span
>");
}
}
@@
-74,7
+79,7
@@
BOOST_AUTO_TEST_CASE (render_markup_test3)
{
std::list<SubtitleString> s;
add (s, "Hello", true, true, false);
{
std::list<SubtitleString> s;
add (s, "Hello", true, true, false);
- BOOST_CHECK_EQUAL (marked_up (s, 1024
), "<i><b>Hello</b></i
>");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span style=\"italic\" weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span
>");
}
/** Test marked_up() in render_subtitles.cc */
}
/** Test marked_up() in render_subtitles.cc */
@@
-82,7
+87,7
@@
BOOST_AUTO_TEST_CASE (render_markup_test4)
{
std::list<SubtitleString> s;
add (s, "Hello", true, true, true);
{
std::list<SubtitleString> s;
add (s, "Hello", true, true, true);
- BOOST_CHECK_EQUAL (marked_up (s, 1024
), "<i><b><u>Hello</u></b></i
>");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span style=\"italic\" weight=\"bold\" underline=\"single\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span
>");
}
/** Test marked_up() in render_subtitles.cc */
}
/** Test marked_up() in render_subtitles.cc */
@@
-91,7
+96,7
@@
BOOST_AUTO_TEST_CASE (render_markup_test5)
std::list<SubtitleString> s;
add (s, "Hello", false, true, false);
add (s, " world.", false, false, false);
std::list<SubtitleString> s;
add (s, "Hello", false, true, false);
add (s, " world.", false, false, false);
- BOOST_CHECK_EQUAL (marked_up (s, 1024
), "<b>Hello</b> world.
");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span><span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\"> world.</span>
");
}
/** Test marked_up() in render_subtitles.cc */
}
/** Test marked_up() in render_subtitles.cc */
@@
-101,5
+106,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);
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, 1024
), "<i>Hello</i> world <b>we are bold.</b
>");
+ BOOST_CHECK_EQUAL (marked_up (s, 1024
, 1), "<span style=\"italic\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span><span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\"> world </span><span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">we are bold.</span
>");
}
}