aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-19 00:32:51 -0500
committerJack Lloyd <[email protected]>2016-12-19 00:32:51 -0500
commit4b1a1fd5ec72df31bc43c5d82311a316c60d61f6 (patch)
tree3faf085ba5270f92d1d50b09e5fd642f9041b035 /src/tests/tests.cpp
parentabac6ab59b363c2ac571d13496a70d98e04a5c2f (diff)
Minor refactoring of Text_Based_Test
Turns out astyle has some bugs wrt C++11 initialize lists. Rather than having astyle mangle all of the tests, convert to using a string which is split once at the start instead of a vector of keys.
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r--src/tests/tests.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp
index b78b7a2e2..81da95736 100644
--- a/src/tests/tests.cpp
+++ b/src/tests/tests.cpp
@@ -547,27 +547,15 @@ std::string Test::random_password()
}
Text_Based_Test::Text_Based_Test(const std::string& data_src,
- const std::vector<std::string>& required_keys,
- const std::vector<std::string>& optional_keys) :
+ const std::string& required_keys_str,
+ const std::string& optional_keys_str) :
m_data_src(data_src)
{
- if(required_keys.empty())
+ if(required_keys_str.empty())
throw Test_Error("Invalid test spec");
- m_required_keys.insert(required_keys.begin(), required_keys.end());
- m_optional_keys.insert(optional_keys.begin(), optional_keys.end());
- m_output_key = required_keys.at(required_keys.size() - 1);
- }
-
-Text_Based_Test::Text_Based_Test(const std::string& algo,
- const std::string& data_src,
- const std::vector<std::string>& required_keys,
- const std::vector<std::string>& optional_keys) :
- m_algo(algo),
- m_data_src(data_src)
- {
- if(required_keys.empty())
- throw Test_Error("Invalid test spec");
+ std::vector<std::string> required_keys = Botan::split_on(required_keys_str, ',');
+ std::vector<std::string> optional_keys = Botan::split_on(optional_keys_str, ',');
m_required_keys.insert(required_keys.begin(), required_keys.end());
m_optional_keys.insert(optional_keys.begin(), optional_keys.end());