diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-16 11:30:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-16 11:30:27 +0200 |
| commit | 4b8f2b64ebb7fcba20c3c03d7bccd08e48612fbb (patch) | |
| tree | 06d00068ef681534f0e64bede699bf1ce5a19929 /test | |
| parent | e2dfb7e571fa80e6216dcedb16e5eaca3c5648d4 (diff) | |
Remove unused code.
Diffstat (limited to 'test')
| -rw-r--r-- | test/crypto_test.cc | 47 | ||||
| -rw-r--r-- | test/wscript | 1 |
2 files changed, 0 insertions, 48 deletions
diff --git a/test/crypto_test.cc b/test/crypto_test.cc deleted file mode 100644 index 53451b352..000000000 --- a/test/crypto_test.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2018-2021 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/crypto.h" -#include "lib/exceptions.h" -#include "test.h" -#include <openssl/rand.h> -#include <boost/test/unit_test.hpp> - - -using std::string; -using std::list; - - -BOOST_AUTO_TEST_CASE (crypto_test) -{ - dcp::ArrayData key (dcpomatic::crypto_key_length()); - dcp::ArrayData iv = dcpomatic::random_iv (); - - RAND_bytes (key.data(), dcpomatic::crypto_key_length()); - - auto ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv); - BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?"); - - key.data()[5]++; - key.data()[6]++; - BOOST_REQUIRE_THROW (dcpomatic::decrypt (ciphertext, key, iv), CryptoError); -} - diff --git a/test/wscript b/test/wscript index 0c9db3889..e8762009c 100644 --- a/test/wscript +++ b/test/wscript @@ -70,7 +70,6 @@ def build(bld): cpl_hash_test.cc cpl_metadata_test.cc create_cli_test.cc - crypto_test.cc dcpomatic_time_test.cc dcp_decoder_test.cc dcp_digest_file_test.cc |
