diff options
author | Jack Lloyd <[email protected]> | 2016-12-24 21:21:39 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-24 21:21:39 -0500 |
commit | 0f3bf4d4d056c41b585b62145d03e1588c24fcec (patch) | |
tree | 24ea7b692eba2f279b3aae9913cf21fe2241f93e /src/tests/test_pubkey.cpp | |
parent | 2ee2d884167e43f84830cd45af63ddbf245b540b (diff) |
Add test option --run-long-tests
Previously longer tests were hidden behind higher 'soak levels'
but these arbitrary cutoffs are confusing compared to a simple
short tests/long tests split.
Diffstat (limited to 'src/tests/test_pubkey.cpp')
-rw-r--r-- | src/tests/test_pubkey.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tests/test_pubkey.cpp b/src/tests/test_pubkey.cpp index 86d04169e..712fa8df4 100644 --- a/src/tests/test_pubkey.cpp +++ b/src/tests/test_pubkey.cpp @@ -33,10 +33,12 @@ void check_invalid_signatures(Test::Result& result, const std::vector<uint8_t>& message, const std::vector<uint8_t>& signature) { + const size_t tests_to_run = (Test::run_long_tests() ? 20 : 5); + const std::vector<uint8_t> zero_sig(signature.size()); result.test_eq("all zero signature invalid", verifier.verify_message(message, zero_sig), false); - for(size_t i = 0; i < Test::soak_level(); ++i) + for(size_t i = 0; i < tests_to_run; ++i) { const std::vector<uint8_t> bad_sig = Test::mutate_vec(signature); @@ -53,9 +55,11 @@ void check_invalid_ciphertexts(Test::Result& result, const std::vector<uint8_t>& plaintext, const std::vector<uint8_t>& ciphertext) { + const size_t tests_to_run = (Test::run_long_tests() ? 20 : 5); + size_t ciphertext_accepted = 0, ciphertext_rejected = 0; - for(size_t i = 0; i < Test::soak_level(); ++i) + for(size_t i = 0; i < tests_to_run; ++i) { const std::vector<uint8_t> bad_ctext = Test::mutate_vec(ciphertext); |