diff options
author | Daniel Neus <[email protected]> | 2016-06-17 11:37:18 +0200 |
---|---|---|
committer | Daniel Neus <[email protected]> | 2016-06-17 16:19:40 +0200 |
commit | 2ea6f9b1963795dad74489b41bc7d37f897d7a21 (patch) | |
tree | c9120503521633ee4a25ac2021b392f33d82e8d7 /src/tests/tests.cpp | |
parent | 601f8f6d6075ff2f944c11d357f2309da0c4deb1 (diff) |
add PKCS#11 support
Diffstat (limited to 'src/tests/tests.cpp')
-rw-r--r-- | src/tests/tests.cpp | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp index a79e05aba..aae4174b9 100644 --- a/src/tests/tests.cpp +++ b/src/tests/tests.cpp @@ -254,34 +254,6 @@ bool Test::Result::test_eq(const std::string& what, bool produced, bool expected return test_is_eq(what, produced, expected); } -bool Test::Result::test_rc_ok(const std::string& what, int rc) - { - if(rc != 0) - { - std::ostringstream err; - err << m_who; - err << " " << what; - err << " unexpectedly failed with error code " << rc; - return test_failure(err.str()); - } - - return test_success(); - } - -bool Test::Result::test_rc_fail(const std::string& func, const std::string& why, int rc) - { - if(rc == 0) - { - std::ostringstream err; - err << m_who; - err << " call to " << func << " unexpectedly succeeded"; - err << " expecting failure because " << why; - return test_failure(err.str()); - } - - return test_success(); - } - bool Test::Result::test_rc(const std::string& func, int expected, int rc) { if(expected != rc) @@ -436,17 +408,20 @@ Botan::RandomNumberGenerator* Test::m_test_rng = nullptr; std::string Test::m_data_dir; size_t Test::m_soak_level = 0; bool Test::m_log_success = false; +std::string Test::m_pkcs11_lib; //static void Test::setup_tests(size_t soak, bool log_success, const std::string& data_dir, + const std::string& pkcs11_lib, Botan::RandomNumberGenerator* rng) { m_data_dir = data_dir; m_soak_level = soak; m_log_success = log_success; m_test_rng = rng; + m_pkcs11_lib = pkcs11_lib; } //static @@ -474,6 +449,12 @@ bool Test::log_success() } //static +std::string Test::pkcs11_lib() + { + return m_pkcs11_lib; + } + +//static Botan::RandomNumberGenerator& Test::rng() { if(!m_test_rng) |