From 13d82e32bd8516c95861dc52521625e5d2a73071 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Feb 2020 11:32:34 -0800 Subject: [PATCH] Don't use internal GTest API --- test/assert-test.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/assert-test.cc b/test/assert-test.cc index 26a87a7b..bc728b53 100644 --- a/test/assert-test.cc +++ b/test/assert-test.cc @@ -8,17 +8,12 @@ #include "fmt/core.h" #include "gtest.h" -#if GTEST_HAS_DEATH_TEST -# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ - EXPECT_DEBUG_DEATH(statement, regex) -#else -# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) -#endif - TEST(AssertTest, Fail) { - EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"), - "don't panic!"); +#if GTEST_HAS_DEATH_TEST + EXPECT_DEBUG_DEATH(FMT_ASSERT(false, "don't panic!"), "don't panic!"); +#else + fmt::print("warning: death tests are not supported\n"); +#endif } bool test_condition = false;