Fixes for the bad distros.
[libdcp.git] / test / read_dcp_test.cc
1 /*
2     Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
3
4     This file is part of libdcp.
5
6     libdcp is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     libdcp is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with libdcp.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include <boost/test/unit_test.hpp>
21 #include <boost/optional/optional_io.hpp>
22 #include "dcp.h"
23 #include "cpl.h"
24
25 using std::list;
26 using boost::shared_ptr;
27
28 /** Read a SMPTE DCP that is in git and make sure that basic stuff is read in correctly */
29 BOOST_AUTO_TEST_CASE (read_dcp_test1)
30 {
31         dcp::DCP d ("test/ref/DCP/dcp_test1");
32         d.read ();
33
34         list<shared_ptr<dcp::CPL> > cpls = d.cpls ();
35         BOOST_CHECK_EQUAL (cpls.size(), 1);
36
37         BOOST_CHECK_EQUAL (cpls.front()->annotation_text(), "A Test DCP");
38         BOOST_CHECK_EQUAL (cpls.front()->content_kind(), dcp::FEATURE);
39         BOOST_REQUIRE (d.standard());
40         BOOST_CHECK_EQUAL (d.standard(), dcp::SMPTE);
41 }
42
43 /** Read an Interop DCP that is in git and make sure that basic stuff is read in correctly */
44 BOOST_AUTO_TEST_CASE (read_dcp_test2)
45 {
46         dcp::DCP d ("test/ref/DCP/dcp_test3");
47         d.read ();
48
49         list<shared_ptr<dcp::CPL> > cpls = d.cpls ();
50         BOOST_CHECK_EQUAL (cpls.size(), 1);
51
52         BOOST_CHECK_EQUAL (cpls.front()->annotation_text(), "Test_FTR-1_F-119_10_2K_20160524_IOP_OV");
53         BOOST_CHECK_EQUAL (cpls.front()->content_kind(), dcp::FEATURE);
54         BOOST_REQUIRE (d.standard());
55         BOOST_CHECK_EQUAL (d.standard(), dcp::INTEROP);
56 }