X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftests.cc;h=42198abdb5ffd943cccae3abc69d360c7bc99852;hb=afeea0415dd56a3106a4c71df2e4a6ccc2d72e74;hp=bbd877bad78561ca4827cebe352edeaf26d22a95;hpb=5707835af6a7a232b18afbf3fa602e8074d69aaa;p=libdcp.git diff --git a/test/tests.cc b/test/tests.cc index bbd877ba..42198abd 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -17,60 +17,78 @@ */ +#include #include +#include #include "KM_prng.h" #include "dcp.h" #include "util.h" #include "metadata.h" #include "types.h" #include "exceptions.h" +#include "subtitle_asset.h" +#include "picture_asset.h" +#include "sound_asset.h" +#include "reel.h" +#include "certificates.h" +#include "crypt_chain.h" +#include "gamma_lut.h" +#include "cpl.h" +#include "encryption.h" #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE libdcp_test #include -using namespace std; -using namespace boost; +using std::string; +using std::cout; +using std::vector; +using std::list; +using boost::shared_ptr; -string +struct TestConfig +{ + TestConfig() + { + libdcp::init (); + } +}; + +BOOST_GLOBAL_FIXTURE (TestConfig); + +static string j2c (int) { return "test/data/32x32_red_square.j2c"; } -string +static string wav (libdcp::Channel) { return "test/data/1s_24-bit_48k_silence.wav"; } - -BOOST_AUTO_TEST_CASE (dcp_test) -{ - Kumu::libdcp_test = true; - - libdcp::Metadata* t = libdcp::Metadata::instance (); - t->issuer = "OpenDCP 0.0.25"; - t->creator = "OpenDCP 0.0.25"; - t->company_name = "OpenDCP"; - t->product_name = "OpenDCP"; - t->product_version = "0.0.25"; - t->issue_date = "2012-07-17T04:45:18+00:00"; - filesystem::remove_all ("build/test/foo"); - filesystem::create_directories ("build/test/foo"); - libdcp::DCP d ("build/test/foo", "A Test DCP", libdcp::DCP::FEATURE, 24, 24); +static string test_corpus = "../libdcp-test"; - d.add_picture_asset (sigc::ptr_fun (&j2c), 32, 32); - d.add_sound_asset (sigc::ptr_fun (&wav), 2); +#include "utc_offset_to_string_test.cc" +#include "lut_test.cc" +#include "util_test.cc" +#include "decryption_test.cc" +#include "kdm_test.cc" +#include "dcp_test.cc" +#include "error_test.cc" +#include "read_dcp_test.cc" +#include "subtitle_tests.cc" +#include "dcp_time_test.cc" +#include "color_test.cc" +#include "recovery_test.cc" +#include "certificates_test.cc" - d.write_xml (); -} - -BOOST_AUTO_TEST_CASE (error_test) +BOOST_AUTO_TEST_CASE (crypt_chain) { - libdcp::DCP d ("build/test/bar", "A Test DCP", libdcp::DCP::TEST, 24, 24); - vector p; - p.push_back ("frobozz"); - BOOST_CHECK_THROW (d.add_picture_asset (p, 32, 32), libdcp::FileError); - BOOST_CHECK_THROW (d.add_sound_asset (p), libdcp::FileError); + boost::filesystem::remove_all ("build/test/crypt"); + boost::filesystem::create_directory ("build/test/crypt"); + libdcp::make_crypt_chain ("build/test/crypt"); } + +#include "encryption_test.cc"