diff options
Diffstat (limited to '')
-rw-r--r-- | src/seastar/fmt/test/assert-test.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/seastar/fmt/test/assert-test.cc b/src/seastar/fmt/test/assert-test.cc new file mode 100644 index 00000000..8af9b09f --- /dev/null +++ b/src/seastar/fmt/test/assert-test.cc @@ -0,0 +1,22 @@ +// Formatting library for C++ - assertion tests +// +// Copyright (c) 2012 - present, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#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!"); +} |