2 Copyright (C) 2013 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.
20 #include <boost/test/unit_test.hpp>
24 #include "mono_picture_asset.h"
25 #include "sound_asset.h"
30 using boost::shared_ptr;
32 /* Test creation of a DCP from very simple inputs */
33 BOOST_AUTO_TEST_CASE (dcp_test)
35 Kumu::libdcp_test = true;
37 /* Some known metadata */
38 dcp::XMLMetadata xml_meta;
39 xml_meta.issuer = "OpenDCP 0.0.25";
40 xml_meta.creator = "OpenDCP 0.0.25";
41 xml_meta.issue_date = "2012-07-17T04:45:18+00:00";
42 dcp::MXFMetadata mxf_meta;
43 mxf_meta.company_name = "OpenDCP";
44 mxf_meta.product_name = "OpenDCP";
45 mxf_meta.product_version = "0.0.25";
47 /* We're making build/test/foo */
48 boost::filesystem::remove_all ("build/test/foo");
49 boost::filesystem::create_directories ("build/test/foo");
50 dcp::DCP d ("build/test/foo");
51 shared_ptr<dcp::CPL> cpl (new dcp::CPL ("build/test/foo", "A Test DCP", dcp::FEATURE, 24, 24));
53 shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset ("build/test/foo", "video.mxf"));
54 mp->set_progress (&d.Progress);
55 mp->set_edit_rate (24);
56 mp->set_intrinsic_duration (24);
57 mp->set_duration (24);
58 mp->set_size (dcp::Size (32, 32));
59 mp->set_metadata (mxf_meta);
62 shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset ("build/test/foo", "audio.mxf"));
63 ms->set_progress (&d.Progress);
64 ms->set_edit_rate (24);
65 ms->set_intrinsic_duration (24);
66 ms->set_duration (24);
68 ms->set_metadata (mxf_meta);
71 cpl->add_reel (shared_ptr<dcp::Reel> (new dcp::Reel (mp, ms, shared_ptr<dcp::SubtitleAsset> ())));
74 d.write_xml (false, xml_meta);
76 /* build/test/foo is checked against test/ref/DCP/foo by run-tests.sh */