Don't run status_test malloc tests on asan/msan
From past experience, the malloc hooks don't play nice with msan/asan,
so just disable the tests in these scenarios.
Change-Id: I9bce565cf9a4fb171192e7ffe494391c492cf331
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/util/status_test.cc b/aos/util/status_test.cc
index 0caf73d..46c9e40 100644
--- a/aos/util/status_test.cc
+++ b/aos/util/status_test.cc
@@ -64,9 +64,11 @@
line)));
}
+// Malloc hooks don't work with asan/msan.
+#if !__has_feature(address_sanitizer) && !__has_feature(memory_sanitizer)
// Tests that we do indeed malloc (and catch it) on an extra-long error message
// (this is mostly intended to ensure that the test setup is working correctly).
-TEST(StatusDeatTest, BlowsUpOnRealtimeAllocation) {
+TEST(StatusDeathTest, BlowsUpOnRealtimeAllocation) {
std::string message(" ", Status::kStaticMessageLength + 1);
EXPECT_DEATH(
{
@@ -77,8 +79,10 @@
"Malloced");
}
+#endif
+
// Tests that we can use arbitrarily-sized string literals for error messages.
-TEST(StatusDeatTest, StringLiteralError) {
+TEST_F(StatusTest, StringLiteralError) {
std::optional<Status> error;
const char *message =
"Hellllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll"