Move some CPL writing from picture/sound assets to the MXF. Pick up key_id from...
[libdcp.git] / test / tests.cc
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
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.
8
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.
13
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.
17
18 */
19
20 #include <cmath>
21 #include <boost/filesystem.hpp>
22 #include <libxml++/libxml++.h>
23 #include "KM_prng.h"
24 #include "dcp.h"
25 #include "util.h"
26 #include "metadata.h"
27 #include "types.h"
28 #include "exceptions.h"
29 #include "subtitle_asset.h"
30 #include "picture_asset.h"
31 #include "sound_asset.h"
32 #include "reel.h"
33 #include "certificates.h"
34 #include "crypt_chain.h"
35 #include "gamma_lut.h"
36 #include "cpl.h"
37 #include "encryption.h"
38
39 #define BOOST_TEST_DYN_LINK
40 #define BOOST_TEST_MODULE libdcp_test
41 #include <boost/test/unit_test.hpp>
42
43 using std::string;
44 using std::cout;
45 using std::vector;
46 using std::list;
47 using boost::shared_ptr;
48
49 struct TestConfig
50 {
51         TestConfig()
52         {
53                 libdcp::init ();
54         }
55 };
56
57 BOOST_GLOBAL_FIXTURE (TestConfig);
58
59 static string
60 j2c (int)
61 {
62         return "test/data/32x32_red_square.j2c";
63 }
64
65 static string
66 wav (libdcp::Channel)
67 {
68         return "test/data/1s_24-bit_48k_silence.wav";
69 }
70
71 static string test_corpus = "../libdcp-test";
72
73 #include "decryption_test.cc"
74 #include "dcp_test.cc"
75 #include "error_test.cc"
76 #include "read_dcp_test.cc"
77 #include "subtitle_tests.cc"
78 #include "dcp_time_test.cc"
79 #include "color_test.cc"
80 #include "recovery_test.cc"
81
82 //BOOST_AUTO_TEST_CASE (crypt_chain)
83 //{
84 //      boost::filesystem::remove_all ("build/test/crypt");
85 //      boost::filesystem::create_directory ("build/test/crypt");
86 //      libdcp::make_crypt_chain ("build/test/crypt");
87 //}
88
89 //#include "encryption_test.cc"
90 //#include "certificates_test.cc"