]>
git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/fmt/test/test-assert.h
1 // Formatting library for C++ - test version of FMT_ASSERT
3 // Copyright (c) 2012 - present, Victor Zverovich
4 // All rights reserved.
6 // For the license information refer to format.h.
8 #ifndef FMT_TEST_ASSERT_H_
9 #define FMT_TEST_ASSERT_H_
14 class assertion_failure
: public std::logic_error
{
16 explicit assertion_failure(const char *message
) : std::logic_error(message
) {}
19 #define FMT_ASSERT(condition, message) \
20 if (!(condition)) throw assertion_failure(message);
22 // Expects an assertion failure.
23 #define EXPECT_ASSERT(stmt, message) \
24 FMT_TEST_THROW_(stmt, assertion_failure, message, GTEST_NONFATAL_FAILURE_)
26 #endif // FMT_TEST_ASSERT_H_