Skip to content

Commit 107c501

Browse files
fixup! Add macro for static variable definition
1 parent 0c45cb4 commit 107c501

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

test/test.cc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8471,10 +8471,26 @@ TEST(ClientInThreadTest, Issue2068) {
84718471
}
84728472
}
84738473

8474+
#if defined(__SANITIZE_ADDRESS__)
8475+
#define ASAN_ENABLED 1
8476+
#else
8477+
#if defined(__has_feature)
8478+
#if __has_feature(address_sanitizer)
8479+
#define ASAN_ENABLED 1
8480+
#else
8481+
#define ASAN_ENABLED 0
8482+
#endif
8483+
#else
8484+
#define ASAN_ENABLED 0
8485+
#endif
8486+
#endif
8487+
8488+
#if ASAN_ENABLED
84748489
Server *issue2097_svr = nullptr;
84758490
std::thread *issue2097_svr_thread = nullptr;
84768491

84778492
TEST(ExitTimeDtorsTest, Issue2097) {
8493+
GTEST_FLAG_SET(death_test_style, "threadsafe");
84788494
ASSERT_EXIT(
84798495
{
84808496
issue2097_svr = new Server();
@@ -8510,7 +8526,8 @@ TEST(ExitTimeDtorsTest, Issue2097) {
85108526
#ifdef CPPHTTPLIB_NO_EXIT_TIME_DESTRUCTORS
85118527
::testing::ExitedWithCode(42),
85128528
#else
8513-
::testing::KilledBySignal(SIGSEGV),
8529+
::testing::ExitedWithCode(1),
85148530
#endif
85158531
"");
8516-
}
8532+
}
8533+
#endif

0 commit comments

Comments
 (0)