aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_stream.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-01 15:07:46 -0400
committerJack Lloyd <[email protected]>2016-09-01 15:07:46 -0400
commitcd9f852b46f62087dcf7940303a0fe52a009e6c7 (patch)
treea91852c9e670e7b89795c9c52928fbcc21959784 /src/tests/test_stream.cpp
parente4656be6a8e601b64c759906bacf543388b3cf22 (diff)
Let the input arg to stream cipher test be optional.
If ommitted, assume an all zero input. Remove some In = 0000... from test files.
Diffstat (limited to 'src/tests/test_stream.cpp')
-rw-r--r--src/tests/test_stream.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/test_stream.cpp b/src/tests/test_stream.cpp
index d3d83c26c..be7b9a548 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);