From 25db4064b7eb6af591d2898de2122630fce4427b Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 25 Oct 2015 18:42:38 +0100 Subject: [PATCH] Use EXPECT_EXIT instead of EXPECT_DEATH --- test/logging/LoggingTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/logging/LoggingTest.cpp b/test/logging/LoggingTest.cpp index cf24e2c8..6e26280e 100644 --- a/test/logging/LoggingTest.cpp +++ b/test/logging/LoggingTest.cpp @@ -65,16 +65,16 @@ TEST_F(LoggingTest, ErrorLog) { void logAndExit(const string &message) { LOG(INFO) << message; - abort(); + exit(1); } // fork() only forks the main thread. This test ensures that logging doesn't depend on threads that suddenly aren't // there anymore after a fork(). TEST_F(LoggingTest, LoggingAlsoWorksAfterFork) { setLogger(spdlog::stderr_logger_mt("StderrLogger")); - //TODO Use EXPECT_EXIT instead once the gtest version is new enough to support it - EXPECT_DEATH( + EXPECT_EXIT( logAndExit("My log message"), + ::testing::ExitedWithCode(1), "My log message" ); }