projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Another macOS build fix.
[dcpomatic.git]
/
test
/
render_subtitles_test.cc
diff --git
a/test/render_subtitles_test.cc
b/test/render_subtitles_test.cc
index 4276a2b01e58ae155a595a5f223bcb3303484001..5774c8e9af7e111dc4d5140eb68c39fc33627b2f 100644
(file)
--- a/
test/render_subtitles_test.cc
+++ b/
test/render_subtitles_test.cc
@@
-18,20
+18,20
@@
*/
*/
-/** @file test/render_
subtitles
_test.cc
+/** @file test/render_
text
_test.cc
* @brief Check markup of subtitles for rendering.
* @brief Check markup of subtitles for rendering.
- * @ingroup
specific
+ * @ingroup
feature
*/
*/
-#include "lib/render_
subtitles
.h"
+#include "lib/render_
text
.h"
#include <dcp/subtitle_string.h>
#include <boost/test/unit_test.hpp>
static void
#include <dcp/subtitle_string.h>
#include <boost/test/unit_test.hpp>
static void
-add (std::list<S
ubtitleString
>& s, std::string text, bool italic, bool bold, bool underline)
+add (std::list<S
tringText
>& s, std::string text, bool italic, bool bold, bool underline)
{
s.push_back (
{
s.push_back (
- S
ubtitleString
(
+ S
tringText
(
dcp::SubtitleString (
boost::optional<std::string> (),
italic,
dcp::SubtitleString (
boost::optional<std::string> (),
italic,
@@
-43,68
+43,70
@@
add (std::list<SubtitleString>& s, std::string text, bool italic, bool bold, boo
dcp::Time (),
dcp::Time (),
1,
dcp::Time (),
dcp::Time (),
1,
- dcp::HA
LIGN_
LEFT,
+ dcp::HA
lign::
LEFT,
1,
1,
- dcp::VA
LIGN_
TOP,
- dcp::D
IRECTION_
LTR,
+ dcp::VA
lign::
TOP,
+ dcp::D
irection::
LTR,
text,
text,
- dcp::NONE,
+ dcp::
Effect::
NONE,
dcp::Colour (0, 0, 0),
dcp::Time (),
dcp::Colour (0, 0, 0),
dcp::Time (),
- dcp::Time ()
- )
+ dcp::Time (),
+ 0
+ ),
+ 2
)
);
}
)
);
}
-/** Test marked_up() in render_
subtitles
.cc */
+/** Test marked_up() in render_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test1)
{
BOOST_AUTO_TEST_CASE (render_markup_test1)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
add (s, "Hello", false, false, false);
add (s, "Hello", false, false, false);
- BOOST_CHECK_EQUAL (marked_up
(s, 1024, 1
), "<span size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
+ 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_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test2)
{
BOOST_AUTO_TEST_CASE (render_markup_test2)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
add (s, "Hello", false, true, false);
add (s, "Hello", false, true, false);
- BOOST_CHECK_EQUAL (marked_up
(s, 1024, 1
), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
+ BOOST_CHECK_EQUAL (marked_up
(s, 1024, 1, ""
), "<span weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
}
}
-/** Test marked_up() in render_
subtitles
.cc */
+/** Test marked_up() in render_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test3)
{
BOOST_AUTO_TEST_CASE (render_markup_test3)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
add (s, "Hello", true, true, false);
add (s, "Hello", true, true, false);
- BOOST_CHECK_EQUAL (marked_up
(s, 1024, 1
), "<span style=\"italic\" weight=\"bold\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
+ 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_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test4)
{
BOOST_AUTO_TEST_CASE (render_markup_test4)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
add (s, "Hello", true, true, true);
add (s, "Hello", true, true, true);
- BOOST_CHECK_EQUAL (marked_up
(s, 1024, 1
), "<span style=\"italic\" weight=\"bold\" underline=\"single\" size=\"41472\" alpha=\"65535\" color=\"#FFFFFF\">Hello</span>");
+ 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_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test5)
{
BOOST_AUTO_TEST_CASE (render_markup_test5)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
add (s, "Hello", false, true, false);
add (s, " world.", false, false, false);
add (s, "Hello", false, true, false);
add (s, " world.", false, false, false);
- 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>");
+ 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_
text
.cc */
BOOST_AUTO_TEST_CASE (render_markup_test6)
{
BOOST_AUTO_TEST_CASE (render_markup_test6)
{
- std::list<S
ubtitleString
> s;
+ std::list<S
tringText
> s;
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, 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>");
+ 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>");
}
}