diff options
author | Jack Lloyd <[email protected]> | 2015-11-11 05:43:01 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-11-11 05:43:01 -0500 |
commit | cf05aea092fad448c2f4a8e8b66159237096ba8e (patch) | |
tree | 00631bcc84809a1eeac5dd32dd92c62143ef831b /src/tests/test_transform.cpp | |
parent | 6bb38ae2fa0e1be46b3a3256ac03f435b16a57ea (diff) |
Update and consolidate the test framework.
The tests previously had used 4 to 6 different schemes internally (the vec file
reader framework, Catch, the old InSiTo Boost.Test tests, the PK/BigInt tests
which escaped the rewrite in 1.11.7, plus a number of one-offs). Converge on a
design that works everywhere, and update all the things.
Fix also a few bugs found by the test changes: SHA-512-256 name incorrect,
OpenSSL RC4 name incorrect, signature of FFI function botan_pubkey_destroy
was wrong.
Diffstat (limited to 'src/tests/test_transform.cpp')
-rw-r--r-- | src/tests/test_transform.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/tests/test_transform.cpp b/src/tests/test_transform.cpp deleted file mode 100644 index a4a26b0a7..000000000 --- a/src/tests/test_transform.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -* (C) 2014,2015 Jack Lloyd -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#include "tests.h" - -#include <botan/transform.h> -#include <botan/hex.h> -#include <iostream> -#include <fstream> - -using namespace Botan; - -namespace { - -secure_vector<byte> transform_test(const std::string& algo, - const secure_vector<byte>& nonce, - const secure_vector<byte>& key, - const secure_vector<byte>& in) - { - std::unique_ptr<Transform> t(get_transform(algo)); - - if(Keyed_Transform* keyed = dynamic_cast<Keyed_Transform*>(t.get())) - keyed->set_key(key); - - secure_vector<byte> out = in; - - t->start(nonce); - t->finish(out); - return out; - } - -} - -size_t test_transform() - { - std::ifstream vec(TEST_DATA_DIR "/transform.vec"); - - return run_tests(vec, "Transform", "Output", true, - [](std::map<std::string, std::string> m) - { - return hex_encode(transform_test(m["Transform"], - hex_decode_locked(m["Nonce"]), - hex_decode_locked(m["Key"]), - hex_decode_locked(m["Input"]))); - }); - } |