aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_dl_group.cpp
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2018-04-06 20:20:35 +0200
committerMatthias Gierlings <[email protected]>2018-04-06 20:25:45 +0200
commit4476c07bae00dc2cec5183878d81b3e53ff3b97e (patch)
tree2ab30848e3a561f5999a196187aebdcbafae3faf /src/tests/test_dl_group.cpp
parent4292f41101bb86d528252d8395ffb93eb9fa3528 (diff)
Make tests pass by default in UBSAN mode
- Adds macros to check if botan was compiled with a certain sanitizers. - Automatically excludes the tests that are intended to provoke undefined behaviour from the test bench, when botan is compiled with UBSAN. - Changes option `--avoid-undefined` to `--no-avoid-undefined` so the failing tests can be explicitly activated when needed.
Diffstat (limited to 'src/tests/test_dl_group.cpp')
-rw-r--r--src/tests/test_dl_group.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/test_dl_group.cpp b/src/tests/test_dl_group.cpp
index 10a7e3bc6..c9e654bd7 100644
--- a/src/tests/test_dl_group.cpp
+++ b/src/tests/test_dl_group.cpp
@@ -44,16 +44,19 @@ class DL_Group_Tests final : public Test
"DL_Group uninitialized",
[]() { Botan::DL_Group dl; dl.get_p(); });
- if(Test::avoid_undefined_behavior() == false)
+#if defined(BOTAN_HAS_SANITIZER_UNDEFINED)
+ if(Test::no_avoid_undefined_behavior())
{
+#endif
result.test_throws("Bad generator param",
"Invalid argument DL_Group unknown PrimeType",
[]() {
auto invalid_type = static_cast<Botan::DL_Group::PrimeType>(9);
Botan::DL_Group dl(Test::rng(), invalid_type, 1024);
});
+#if defined(BOTAN_HAS_SANITIZER_UNDEFINED)
}
-
+#endif
return result;
}