diff options
-rw-r--r-- | src/tests/test_block.cpp | 5 | ||||
-rw-r--r-- | src/tests/test_hash.cpp | 2 | ||||
-rw-r--r-- | src/tests/test_mac.cpp | 2 | ||||
-rw-r--r-- | src/tests/test_modes.cpp | 6 | ||||
-rw-r--r-- | src/tests/test_rng.cpp | 10 | ||||
-rw-r--r-- | src/tests/test_stream.cpp | 2 |
6 files changed, 18 insertions, 9 deletions
diff --git a/src/tests/test_block.cpp b/src/tests/test_block.cpp index 32e175899..b688ec84e 100644 --- a/src/tests/test_block.cpp +++ b/src/tests/test_block.cpp @@ -28,7 +28,10 @@ size_t block_test(const std::string& algo, size_t fails = 0; if(providers.empty()) - throw std::runtime_error("Unknown block cipher " + algo); + { + std::cout << "Unknown block cipher " + algo + " skipping test\n"; + return 0; + } for(auto provider: providers) { diff --git a/src/tests/test_hash.cpp b/src/tests/test_hash.cpp index d37a9dc14..42ffcc11a 100644 --- a/src/tests/test_hash.cpp +++ b/src/tests/test_hash.cpp @@ -26,7 +26,7 @@ size_t hash_test(const std::string& algo, if(providers.empty()) { std::cout << "Unknown hash '" << algo << "'" << std::endl; - ++fails; + return 0; } for(auto provider: providers) diff --git a/src/tests/test_mac.cpp b/src/tests/test_mac.cpp index 4009a6c4d..e161e5921 100644 --- a/src/tests/test_mac.cpp +++ b/src/tests/test_mac.cpp @@ -28,7 +28,7 @@ size_t mac_test(const std::string& algo, if(providers.empty()) { std::cout << "Unknown algo " << algo << std::endl; - ++fails; + return 0; } for(auto provider: providers) diff --git a/src/tests/test_modes.cpp b/src/tests/test_modes.cpp index 09e0be8ba..81a15445e 100644 --- a/src/tests/test_modes.cpp +++ b/src/tests/test_modes.cpp @@ -28,20 +28,20 @@ secure_vector<byte> run_mode(const std::string& algo, const secure_vector<byte>& key) { #if 0 - std::unique_ptr<Cipher_Mode> cipher(get_cipher(algo, dir)); + std::unique_ptr<Cipher_Mode> cipher(get_cipher_mode(algo, dir)); cipher->set_key(key); cipher->start(nonce); secure_vector<byte> ct = pt; cipher->finish(ct); -#endif - +#else Pipe pipe(get_cipher(algo, SymmetricKey(key), InitializationVector(nonce), dir)); pipe.process_msg(pt); return pipe.read_all(); +#endif } size_t mode_test(const std::string& algo, diff --git a/src/tests/test_rng.cpp b/src/tests/test_rng.cpp index 7cbd50fa0..2eb8328ee 100644 --- a/src/tests/test_rng.cpp +++ b/src/tests/test_rng.cpp @@ -67,7 +67,10 @@ size_t x931_test(const std::string& algo, std::unique_ptr<RandomNumberGenerator> rng(get_rng(algo, ikm)); if(!rng) - throw std::runtime_error("Unknown RNG " + algo); + { + std::cout << "Unknown RNG " + algo + " skipping test\n"; + return 0; + } const std::string got = hex_encode(rng->random_vec(L)); @@ -87,7 +90,10 @@ size_t hmac_drbg_test(std::map<std::string, std::string> m) std::unique_ptr<RandomNumberGenerator> rng(get_rng(algo, ikm)); if(!rng) - throw std::runtime_error("Unknown RNG " + algo); + { + std::cout << "Unknown RNG " + algo + " skipping test\n"; + return 0; + } rng->reseed(0); // force initialization diff --git a/src/tests/test_stream.cpp b/src/tests/test_stream.cpp index 046c199ec..d91d28d9b 100644 --- a/src/tests/test_stream.cpp +++ b/src/tests/test_stream.cpp @@ -34,7 +34,7 @@ size_t stream_test(const std::string& algo, if(providers.empty()) { std::cout << "Unknown stream cipher " << algo << std::endl; - ++fails; + return 0; } for(auto provider: providers) |