Define sanitizer callbacks that fail tests when triggered.
This commit is contained in:
@@ -11,7 +11,8 @@ FetchContent_Declare(
|
|||||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||||
FetchContent_MakeAvailable(googletest)
|
FetchContent_MakeAvailable(googletest)
|
||||||
|
|
||||||
set(ChaosTests_SOURCE Hash/Md4HasherTests.cpp
|
set(ChaosTests_SOURCE SanCallbacks.cpp
|
||||||
|
Hash/Md4HasherTests.cpp
|
||||||
Hash/Md5HasherTests.cpp
|
Hash/Md5HasherTests.cpp
|
||||||
Hash/Sha1HasherTests.cpp
|
Hash/Sha1HasherTests.cpp
|
||||||
Mac/HmacTests.cpp
|
Mac/HmacTests.cpp
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
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"
|
||||||
Reference in New Issue
Block a user