Skip to content

Commit

Permalink
Don't use internal GTest API
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Feb 24, 2020
1 parent 2161a73 commit 13d82e3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/assert-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
#include "fmt/core.h"
#include "gtest.h"

TEST(AssertTest, Fail) {
#if GTEST_HAS_DEATH_TEST
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
EXPECT_DEBUG_DEATH(statement, regex)
EXPECT_DEBUG_DEATH(FMT_ASSERT(false, "don't panic!"), "don't panic!");
#else
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
fmt::print("warning: death tests are not supported\n");
#endif

TEST(AssertTest, Fail) {
EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
"don't panic!");
}

bool test_condition = false;
Expand Down

0 comments on commit 13d82e3

Please sign in to comment.