diff --git a/ChaosTests/CMakeLists.txt b/ChaosTests/CMakeLists.txt index 062ff50..a564a66 100644 --- a/ChaosTests/CMakeLists.txt +++ b/ChaosTests/CMakeLists.txt @@ -11,7 +11,8 @@ FetchContent_Declare( set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) -set(ChaosTests_SOURCE Hash/Md4HasherTests.cpp +set(ChaosTests_SOURCE SanCallbacks.cpp + Hash/Md4HasherTests.cpp Hash/Md5HasherTests.cpp Hash/Sha1HasherTests.cpp Mac/HmacTests.cpp diff --git a/ChaosTests/SanCallbacks.cpp b/ChaosTests/SanCallbacks.cpp new file mode 100644 index 0000000..783800c --- /dev/null +++ b/ChaosTests/SanCallbacks.cpp @@ -0,0 +1,21 @@ +#include + +extern "C" +{ + +void __ubsan_on_report() +{ + FAIL() << "Encountered an undefined behavior sanitizer error"; +} + +void __asan_on_error() +{ + FAIL() << "Encountered an address sanitizer error"; +} + +void __tsan_on_report() +{ + FAIL() << "Encountered a thread sanitizer error"; +} + +} // extern "C"