diff options
Diffstat (limited to 'src/tests/test_stream.cpp')
-rw-r--r-- | src/tests/test_stream.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/test_stream.cpp b/src/tests/test_stream.cpp index d3d83c26c..6097fd3e8 100644 --- a/src/tests/test_stream.cpp +++ b/src/tests/test_stream.cpp @@ -18,15 +18,18 @@ class Stream_Cipher_Tests : public Text_Based_Test { public: Stream_Cipher_Tests(): Text_Based_Test("stream", - {"Key", "In", "Out"}, {"Nonce", "Seek"}) {} + std::vector<std::string>{"Key", "Out"}, {"In", "Nonce", "Seek"}) {} Test::Result run_one_test(const std::string& algo, const VarMap& vars) override { const std::vector<uint8_t> key = get_req_bin(vars, "Key"); - const std::vector<uint8_t> input = get_req_bin(vars, "In"); const std::vector<uint8_t> expected = get_req_bin(vars, "Out"); const std::vector<uint8_t> nonce = get_opt_bin(vars, "Nonce"); const size_t seek = get_opt_sz(vars, "Seek", 0); + std::vector<uint8_t> input = get_opt_bin(vars, "In"); + + if(input.empty()) + input.resize(expected.size()); Test::Result result(algo); @@ -38,16 +41,18 @@ class Stream_Cipher_Tests : public Text_Based_Test return result; } - for(auto&& provider: providers) + for(auto&& provider_ask : providers) { - std::unique_ptr<Botan::StreamCipher> cipher(Botan::StreamCipher::create(algo, provider)); + std::unique_ptr<Botan::StreamCipher> cipher(Botan::StreamCipher::create(algo, provider_ask)); if(!cipher) { - result.note_missing(algo + " from " + provider); + result.note_missing(algo + " from " + provider_ask); continue; } + const std::string provider(cipher->provider()); + result.test_is_nonempty("provider", provider); result.test_eq(provider, cipher->name(), algo); cipher->set_key(key); |