aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_ecdsa.cpp
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2018-04-07 17:47:11 +0200
committerMatthias Gierlings <[email protected]>2018-04-07 18:03:37 +0200
commita96d1ca450a9cadea8157f3295a970af1f16a58f (patch)
tree08ff02463b8e61f1caf123ca4799c62347dcae34 /src/tests/unit_ecdsa.cpp
parent4476c07bae00dc2cec5183878d81b3e53ff3b97e (diff)
Moves UBSAN macros from test files to Test_Options
To keep the code more readable change the behavior of `Test_Options::no_avoid_undefined_behavior()`, instead of the conditionals inside the tests. `Test_Options::no_avoid_undefined_behavior()` will always return `true` if UBSAN is inactive. This way all tests, including those that cause undefined behaviour, will run. Once botan is compiled with UBSAN those tests will be automatically skipped unless the `--no-avoid-undefined` is passed to the test-bench.
Diffstat (limited to 'src/tests/unit_ecdsa.cpp')
-rw-r--r--src/tests/unit_ecdsa.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/tests/unit_ecdsa.cpp b/src/tests/unit_ecdsa.cpp
index f94f445ee..e21d4764c 100644
--- a/src/tests/unit_ecdsa.cpp
+++ b/src/tests/unit_ecdsa.cpp
@@ -299,18 +299,14 @@ Test::Result test_encoding_options()
result.test_eq("Hybrid point same size as uncompressed",
enc_uncompressed.size(), enc_hybrid.size());
-#if defined(BOTAN_HAS_SANITIZER_UNDEFINED)
if(Test::no_avoid_undefined_behavior())
{
-#endif
auto invalid_format = static_cast<Botan::PointGFp::Compression_Type>(99);
result.test_throws("Invalid point format throws",
"Invalid argument Invalid point encoding for EC_PublicKey",
[&] { key.set_point_encoding(invalid_format); });
-#if defined(BOTAN_HAS_SANITIZER_UNDEFINED)
}
-#endif
return result;
}