summaryrefslogtreecommitdiff
path: root/test/stl_binary_writer_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-29 15:15:37 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-29 15:15:37 +0100
commit97495d8cce58f0e5d9a43977698c60b8b66a83e3 (patch)
treeb2b13eb769002b6e0e0134ed98320cb507705e78 /test/stl_binary_writer_test.cc
parentf6fb2090f4180f8cd507d694f7eb663b3f25d2f0 (diff)
Various tinkering with STL write.
Diffstat (limited to 'test/stl_binary_writer_test.cc')
-rw-r--r--test/stl_binary_writer_test.cc60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/stl_binary_writer_test.cc b/test/stl_binary_writer_test.cc
index 3960ea2..fafa14f 100644
--- a/test/stl_binary_writer_test.cc
+++ b/test/stl_binary_writer_test.cc
@@ -27,7 +27,67 @@ using std::list;
BOOST_AUTO_TEST_CASE (stl_binary_writer_test)
{
list<sub::Subtitle> subs;
+
+ {
+ sub::Subtitle s;
+ s.vertical_position.line = 0;
+ s.from.set_frame (sub::FrameTime (0, 0, 41, 9));
+ s.to.set_frame (sub::FrameTime (0, 0, 42, 21));
+
+ sub::Block b;
+ b.text = "This is a subtitle ";
+ b.font = "Arial";
+ b.font_size.set_points (42);
+ s.blocks.push_back (b);
+ }
+ {
+ sub::Subtitle s;
+ s.vertical_position.line = 1;
+ s.from.set_frame (sub::FrameTime (0, 0, 41, 9));
+ s.to.set_frame (sub::FrameTime (0, 0, 42, 21));
+
+ sub::Block b;
+ b.text = " and that's a line break";
+ b.font = "Arial";
+ b.font_size.set_points (42);
+ s.blocks.push_back (b);
+ }
+
+ {
+ sub::Subtitle s;
+ s.vertical_position.line = 0;
+ s.from.set_frame (sub::FrameTime (0, 1, 1, 1));
+ s.to.set_frame (sub::FrameTime (0, 1, 2, 10));
+
+ sub::Block b;
+ b.text = "This is some ";
+ b.font = "Arial";
+ b.font_size.set_points (42);
+ s.blocks.push_back (b);
+
+ b.text = "bold";
+ b.bold = true;
+ s.blocks.push_back (b);
+
+ b.text = " and some ";
+ b.bold = false;
+ s.blocks.push_back (b);
+
+ b.text = "bold italic";
+ b.bold = true;
+ b.italic = true;
+ s.blocks.push_back (b);
+
+ b.text = " and some ";
+ b.bold = false;
+ b.italic = false;
+ b.underline = true;
+ s.blocks.push_back (b);
+
+ subs.push_back (s);
+ }
+
sub::write_stl_binary (
subs,
25,