aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/unit_ecdsa.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-31 10:10:38 -0400
committerJack Lloyd <[email protected]>2018-03-31 10:10:38 -0400
commit07f70fafc38ef0956d4cd9176d6f8c578aedd07e (patch)
tree342b35c5392ceecb6f2d765958b32e2b1a63543d /src/tests/unit_ecdsa.cpp
parentbdf71b1f83e227f104f39fcf472ebaa155d98cf1 (diff)
Add --avoid-undefined option
GH #1518
Diffstat (limited to 'src/tests/unit_ecdsa.cpp')
-rw-r--r--src/tests/unit_ecdsa.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tests/unit_ecdsa.cpp b/src/tests/unit_ecdsa.cpp
index f91c1b345..016906e66 100644
--- a/src/tests/unit_ecdsa.cpp
+++ b/src/tests/unit_ecdsa.cpp
@@ -299,11 +299,14 @@ Test::Result test_encoding_options()
result.test_eq("Hybrid point same size as uncompressed",
enc_uncompressed.size(), enc_hybrid.size());
- auto invalid_format = static_cast<Botan::PointGFp::Compression_Type>(99);
+ if(Test::avoid_undefined_behavior() == false)
+ {
+ 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); });
+ result.test_throws("Invalid point format throws",
+ "Invalid argument Invalid point encoding for EC_PublicKey",
+ [&] { key.set_point_encoding(invalid_format); });
+ }
return result;
}