2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "interop_dcp_reader.h"
22 #include "smpte_dcp_reader.h"
23 #include "stl_binary_writer.h"
25 #include <boost/test/unit_test.hpp>
31 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test1)
33 if (private_test.empty ()) {
37 boost::filesystem::path p = private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.xml";
38 sub::write_stl_binary (
39 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader(p).subtitles ()),
45 "300514", "300514", 0,
49 "build/test/fd586c30-6d38-48f2-8241-27359acf184c_sub.stl"
53 private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.stl",
54 "build/test/fd586c30-6d38-48f2-8241-27359acf184c_sub.stl"
58 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test2)
60 if (private_test.empty ()) {
64 boost::filesystem::path p = private_test / "93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.xml";
65 sub::write_stl_binary (
66 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader(p).subtitles ()),
72 "300514", "300514", 0,
76 "build/test/93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl"
80 private_test / "93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl",
81 "build/test/93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl"
85 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test3)
87 if (private_test.empty ()) {
91 boost::filesystem::path p = private_test / "Paddington_FTR_Subs_DE-FR_24fps_R1.xml";
92 sub::write_stl_binary (
93 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader(p).subtitles ()),
99 "300514", "300514", 0,
103 "build/test/Paddington_FTR_Subs_DE-FR_24fps_R1.stl"
107 private_test / "Paddington_FTR_Subs_DE-FR_24fps_R1.stl",
108 "build/test/Paddington_FTR_Subs_DE-FR_24fps_R1.stl"
112 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test4)
114 sub::write_stl_binary (
115 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader("test/data/test1.xml").subtitles ()),
117 sub::LANGUAGE_FRENCH,
121 "300514", "300514", 0,
125 "build/test/test1.stl"
129 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test5)
131 if (private_test.empty ()) {
135 boost::filesystem::path p = private_test / "065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.mxf";
136 sub::write_stl_binary (
137 sub::collect<list<sub::Subtitle> > (sub::SMPTEDCPReader(p, true).subtitles ()),
139 sub::LANGUAGE_FRENCH,
143 "300514", "300514", 0,
147 "build/test/065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl"
151 private_test / "065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl",
152 "build/test/065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl"
156 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test6)
158 if (private_test.empty ()) {
162 boost::filesystem::path p = private_test / "Paddington_FTR_FullSubs_DE_24fps.xml";
163 sub::write_stl_binary (
164 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader(p).subtitles ()),
166 sub::LANGUAGE_GERMAN,
170 "300514", "300514", 0,
174 "build/test/Paddington_FTR_FullSubs_DE_24fps.stl"
178 private_test / "Paddington_FTR_FullSubs_DE_24fps.stl",
179 "build/test/Paddington_FTR_FullSubs_DE_24fps.stl"
183 BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test7)
185 boost::filesystem::path p = "test/data/test3.xml";
186 sub::write_stl_binary (
187 sub::collect<list<sub::Subtitle> > (sub::InteropDCPReader(p).subtitles ()),
189 sub::LANGUAGE_GERMAN,
193 "300514", "300514", 0,
197 "build/test/test3.stl"
201 "test/ref/test3.stl",
202 "build/test/test3.stl"