diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/seastar/fmt/test/assert-test.cc | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/seastar/fmt/test/assert-test.cc')
-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!"); +} |