aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_tls.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-11-11 08:36:09 -0500
committerJack Lloyd <[email protected]>2015-11-11 08:36:09 -0500
commit75dbef27700d22478a5845476bd7b120f72cfe2c (patch)
tree493ff5ef9135477b394c24f1bdaac675e82bf4da /src/tests/unit_tls.cpp
parentf266e5e24b61ace20e79d7e27f178068fed86d64 (diff)
Fix occasional test fails
Increase the iterations of the BigInt::random_integer test. Since things get slow quickly, leave the larger range tests to higher soak levels. In TLS, if the corrupted data causes an exception immediately that's ok because it's corrupted data.
Diffstat (limited to 'src/tests/unit_tls.cpp')
-rw-r--r--src/tests/unit_tls.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp
index 6c15ec4e9..8502352fc 100644
--- a/src/tests/unit_tls.cpp
+++ b/src/tests/unit_tls.cpp
@@ -173,6 +173,8 @@ Test::Result test_tls_handshake(Botan::TLS::Protocol_Version offer_version,
{
bool handshake_done = false;
+ result.test_note("Test round " + std::to_string(r));
+
auto handshake_complete = [&](const Botan::TLS::Session& session) -> bool {
handshake_done = true;
@@ -279,7 +281,14 @@ Test::Result test_tls_handshake(Botan::TLS::Protocol_Version offer_version,
}
catch(std::exception& e)
{
- result.test_failure("server error", e.what());
+ if(corrupt_server_data)
+ {
+ result.test_note("corruption caused server exception");
+ }
+ else
+ {
+ result.test_failure("server error", e.what());
+ }
continue;
}
@@ -294,7 +303,14 @@ Test::Result test_tls_handshake(Botan::TLS::Protocol_Version offer_version,
}
catch(std::exception& e)
{
- result.test_failure("client error", e.what());
+ if(corrupt_client_data)
+ {
+ result.test_note("corruption caused client exception");
+ }
+ else
+ {
+ result.test_failure("client error", e.what());
+ }
continue;
}