diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-23 13:58:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-23 13:58:33 +0100 |
| commit | a332bd6be323f03dad5b180fb237afe54f1bf81e (patch) | |
| tree | 70cf0da21c95941cda478717b15ea71aca4c0bdb /test/ecinema_kdm_test.cc | |
| parent | 1c11eaf92c5d592be6df07e2ac77cfcf65e3ed0c (diff) | |
Remove swaroop variant.
Diffstat (limited to 'test/ecinema_kdm_test.cc')
| -rw-r--r-- | test/ecinema_kdm_test.cc | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/test/ecinema_kdm_test.cc b/test/ecinema_kdm_test.cc deleted file mode 100644 index e44a626ba..000000000 --- a/test/ecinema_kdm_test.cc +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2019 Carl Hetherington <cth@carlh.net> - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. - -*/ - -#include "lib/decrypted_ecinema_kdm.h" -#include "lib/encrypted_ecinema_kdm.h" -#include "lib/config.h" -#include <boost/test/unit_test.hpp> -extern "C" { -#include <libavutil/aes_ctr.h> -} -#include <fstream> - -using std::string; -using boost::optional; - -#ifdef DCPOMATIC_VARIANT_SWAROOP - -BOOST_AUTO_TEST_CASE (ecinema_kdm_roundtrip_test1) -{ - dcp::Key key (AES_CTR_KEY_SIZE); - DecryptedECinemaKDM dec ("123-456-789-0", "Hello world", key, optional<dcp::LocalTime>(), optional<dcp::LocalTime>()); - EncryptedECinemaKDM enc = dec.encrypt (Config::instance()->decryption_chain()->leaf()); - DecryptedECinemaKDM dec2 (enc, *Config::instance()->decryption_chain()->key()); - BOOST_CHECK_EQUAL (dec2.id(), "123-456-789-0"); - BOOST_CHECK_EQUAL (dec2.name(), "Hello world"); - BOOST_CHECK (dec2.key() == key); - BOOST_CHECK (!static_cast<bool>(dec2.not_valid_before())); - BOOST_CHECK (!static_cast<bool>(dec2.not_valid_after())); -} - -BOOST_AUTO_TEST_CASE (ecinema_kdm_roundtrip_test2) -{ - dcp::Key key (AES_CTR_KEY_SIZE); - DecryptedECinemaKDM dec ("123-456-789-0", "Hello world", key, dcp::LocalTime("2019-06-01T15:05:23+01:00"), dcp::LocalTime("2019-07-02T19:10:12+02:00")); - EncryptedECinemaKDM enc = dec.encrypt (Config::instance()->decryption_chain()->leaf()); - DecryptedECinemaKDM dec2 (enc, *Config::instance()->decryption_chain()->key()); - BOOST_CHECK_EQUAL (dec2.id(), "123-456-789-0"); - BOOST_CHECK_EQUAL (dec2.name(), "Hello world"); - BOOST_CHECK (dec2.key() == key); - BOOST_REQUIRE (static_cast<bool>(dec2.not_valid_before())); - BOOST_CHECK_EQUAL (dec2.not_valid_before()->as_string(), "2019-06-01T15:05:23+01:00"); - BOOST_REQUIRE (static_cast<bool>(dec2.not_valid_after())); - BOOST_CHECK_EQUAL (dec2.not_valid_after()->as_string(), "2019-07-02T19:10:12+02:00"); -} - -BOOST_AUTO_TEST_CASE (ecinema_kdm_roundtrip_test3) -{ - dcp::Key key (AES_CTR_KEY_SIZE); - DecryptedECinemaKDM dec ("123-456-789-0", "Hello world", key, optional<dcp::LocalTime>(), optional<dcp::LocalTime>()); - EncryptedECinemaKDM enc = dec.encrypt (Config::instance()->decryption_chain()->leaf()); - string const enc_xml = enc.as_xml (); - EncryptedECinemaKDM enc2 (enc_xml); - DecryptedECinemaKDM dec2 (enc2, *Config::instance()->decryption_chain()->key()); - BOOST_CHECK_EQUAL (dec2.id(), "123-456-789-0"); - BOOST_CHECK_EQUAL (dec2.name(), "Hello world"); - BOOST_CHECK (dec2.key() == key); - BOOST_CHECK (!static_cast<bool>(dec2.not_valid_before())); - BOOST_CHECK (!static_cast<bool>(dec2.not_valid_after())); -} - -BOOST_AUTO_TEST_CASE (ecinema_kdm_roundtrip_test4) -{ - dcp::Key key (AES_CTR_KEY_SIZE); - DecryptedECinemaKDM dec ("123-456-789-0", "Hello world", key, dcp::LocalTime("2019-06-01T15:05:23+01:00"), dcp::LocalTime("2019-07-02T19:10:12+02:00")); - EncryptedECinemaKDM enc = dec.encrypt (Config::instance()->decryption_chain()->leaf()); - string const enc_xml = enc.as_xml(); - EncryptedECinemaKDM enc2 (dcp::file_to_string("build/test/shit_the_bed.xml")); - DecryptedECinemaKDM dec2 (enc2, *Config::instance()->decryption_chain()->key()); - BOOST_CHECK_EQUAL (dec2.id(), "123-456-789-0"); - BOOST_CHECK_EQUAL (dec2.name(), "Hello world"); - BOOST_CHECK (dec2.key() == key); - BOOST_REQUIRE (static_cast<bool>(dec2.not_valid_before())); - BOOST_CHECK_EQUAL (dec2.not_valid_before()->as_string(), "2019-06-01T15:05:23+01:00"); - BOOST_REQUIRE (static_cast<bool>(dec2.not_valid_after())); - BOOST_CHECK_EQUAL (dec2.not_valid_after()->as_string(), "2019-07-02T19:10:12+02:00"); -} - -#endif |
