fmtlegacy/test/assert-test.cc

23 lines
625 B
C++
Raw Normal View History

2018-03-04 17:16:51 +00:00
// Formatting library for C++ - assertion tests
//
// Copyright (c) 2012 - present, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
2015-06-22 15:17:23 +00:00
#include "fmt/core.h"
#include "gtest.h"
2015-06-22 15:17:23 +00:00
#if GTEST_HAS_DEATH_TEST
2019-01-13 02:27:38 +00:00
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
2015-06-22 15:17:23 +00:00
EXPECT_DEBUG_DEATH(statement, regex)
#else
2019-01-13 02:27:38 +00:00
# define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \
GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
2015-06-22 15:17:23 +00:00
#endif
TEST(AssertTest, Fail) {
2019-01-13 02:27:38 +00:00
EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
"don't panic!");
2015-06-22 15:17:23 +00:00
}