From 7fd4f98db8902a015283da289d7c1bcd043fbc53 Mon Sep 17 00:00:00 2001 From: tqcq Date: Sun, 17 Dec 2023 22:18:20 +0800 Subject: [PATCH] fix use EXPECT_EXIT --- tests/ulib/concorrency/countdown_latch_unittest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ulib/concorrency/countdown_latch_unittest.cpp b/tests/ulib/concorrency/countdown_latch_unittest.cpp index ec1d57d..aa1c635 100644 --- a/tests/ulib/concorrency/countdown_latch_unittest.cpp +++ b/tests/ulib/concorrency/countdown_latch_unittest.cpp @@ -1,3 +1,4 @@ +#include "gtest/gtest.h" #include #include #include @@ -52,4 +53,5 @@ TEST(CoundownLatch, Assert) // NOTE https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads GTEST_FLAG_SET(death_test_style, "threadsafe"); EXPECT_DEATH(latch.CountDown(), ".*failed.*"); + EXPECT_EXIT(latch.CountDown(), ::testing::KilledBySignal(SIGABRT), ""); }