|
ZeroErr
|
#include "zeroerr/internal/config.h"#include "zeroerr/format.h"#include "zeroerr/internal/debugbreak.h"#include "zeroerr/internal/decomposition.h"#include "zeroerr/print.h"#include <cstdint>#include <exception>

Go to the source code of this file.
Classes | |
| struct | zeroerr::assert_info |
| This is a one-byte assert info struct, which is used to collect the meta info of an assertion. More... | |
| struct | zeroerr::AssertionData |
| AssertionData is a struct that contains all the information of an assertion. It will be thrown as an exception when the assertion failed. More... | |
| struct | zeroerr::detail::context_helper< T, true > |
| struct | zeroerr::detail::context_helper< T, false > |
Namespaces | |
| namespace | ZEROERR_CLANG_SUPPRESS_WARNING_POP |
| namespace | zeroerr |
| namespace | zeroerr::detail |
Macros | |
| #define | ZEROERR_G_CONTEXT_SCOPE(x) |
| #define | ZEROERR_PRINT_ASSERT_DEFAULT_PRINTER(cond, level, ...) |
| Default printer for assertion messages. | |
| #define | ZEROERR_PRINT_ASSERT(cond, level, pattern, ...) |
| #define | ZEROERR_ASSERT_EXP(cond, level, expect_throw, is_false, ...) |
| #define | ZEROERR_ASSERT_CMP(lhs, op, rhs, level, expect_throw, is_false, ...) |
| #define | ZEROERR_CHECK_LEVEL ZEROERR_WARN |
| #define | ZEROERR_CHECK(cond, ...) |
| #define | ZEROERR_CHECK_NOT(cond, ...) |
| #define | ZEROERR_CHECK_THROWS(cond, ...) |
| #define | ZEROERR_REQUIRE(cond, ...) |
| #define | ZEROERR_REQUIRE_NOT(cond, ...) |
| #define | ZEROERR_REQUIRE_THROWS(cond, ...) |
| #define | ZEROERR_ASSERT(cond, ...) |
| #define | ZEROERR_ASSERT_NOT(cond, ...) |
| #define | ZEROERR_ASSERT_THROWS(cond, ...) |
| #define | CHECK(...) |
| #define | CHECK_NOT(...) |
| #define | CHECK_THROWS(...) |
| #define | REQUIRE(...) |
| #define | REQUIRE_NOT(...) |
| #define | REQUIRE_THROWS(...) |
| #define | ASSERT(...) |
| #define | ASSERT_NOT(...) |
| #define | ASSERT_THROWS(...) |
| #define | ZEROERR_CHECK_EQ(lhs, rhs, ...) |
| #define | ZEROERR_CHECK_NE(lhs, rhs, ...) |
| #define | ZEROERR_CHECK_LT(lhs, rhs, ...) |
| #define | ZEROERR_CHECK_LE(lhs, rhs, ...) |
| #define | ZEROERR_CHECK_GT(lhs, rhs, ...) |
| #define | ZEROERR_CHECK_GE(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_EQ(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_NE(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_LT(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_LE(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_GT(lhs, rhs, ...) |
| #define | ZEROERR_REQUIRE_GE(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_EQ(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_NE(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_LT(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_LE(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_GT(lhs, rhs, ...) |
| #define | ZEROERR_ASSERT_GE(lhs, rhs, ...) |
| #define | CHECK_EQ(...) |
| #define | CHECK_NE(...) |
| #define | CHECK_LT(...) |
| #define | CHECK_LE(...) |
| #define | CHECK_GT(...) |
| #define | CHECK_GE(...) |
| #define | REQUIRE_EQ(...) |
| #define | REQUIRE_NE(...) |
| #define | REQUIRE_LT(...) |
| #define | REQUIRE_LE(...) |
| #define | REQUIRE_GT(...) |
| #define | REQUIRE_GE(...) |
| #define | ASSERT_EQ(...) |
| #define | ASSERT_NE(...) |
| #define | ASSERT_LT(...) |
| #define | ASSERT_LE(...) |
| #define | ASSERT_GT(...) |
| #define | ASSERT_GE(...) |
Enumerations | |
| enum class | zeroerr::assert_level : uint8_t { zeroerr::ZEROERR_WARN_l , zeroerr::ZEROERR_ERROR_l , zeroerr::ZEROERR_FATAL_l } |
| enum class | zeroerr::assert_throw : uint8_t { zeroerr::no_throw , zeroerr::throws , zeroerr::throws_as } |
| enum class | zeroerr::assert_cmp : uint8_t { zeroerr::eq , zeroerr::ne , zeroerr::gt , zeroerr::ge , zeroerr::lt , zeroerr::le } |
Variables | |
| constexpr bool | ZEROERR_CLANG_SUPPRESS_WARNING_POP::_ZEROERR_TEST_CONTEXT = false |
| #define ASSERT | ( | ... | ) |
| #define ASSERT_EQ | ( | ... | ) |
| #define ASSERT_GE | ( | ... | ) |
| #define ASSERT_GT | ( | ... | ) |
| #define ASSERT_LE | ( | ... | ) |
| #define ASSERT_LT | ( | ... | ) |
| #define ASSERT_NE | ( | ... | ) |
| #define ASSERT_NOT | ( | ... | ) |
| #define ASSERT_THROWS | ( | ... | ) |
| #define CHECK | ( | ... | ) |
| #define CHECK_EQ | ( | ... | ) |
| #define CHECK_GE | ( | ... | ) |
| #define CHECK_GT | ( | ... | ) |
| #define CHECK_LE | ( | ... | ) |
| #define CHECK_LT | ( | ... | ) |
| #define CHECK_NE | ( | ... | ) |
| #define CHECK_NOT | ( | ... | ) |
| #define CHECK_THROWS | ( | ... | ) |
| #define REQUIRE | ( | ... | ) |
| #define REQUIRE_EQ | ( | ... | ) |
| #define REQUIRE_GE | ( | ... | ) |
| #define REQUIRE_GT | ( | ... | ) |
| #define REQUIRE_LE | ( | ... | ) |
| #define REQUIRE_LT | ( | ... | ) |
| #define REQUIRE_NE | ( | ... | ) |
| #define REQUIRE_NOT | ( | ... | ) |
| #define REQUIRE_THROWS | ( | ... | ) |
| #define ZEROERR_ASSERT | ( | cond, | |
| ... ) |
| #define ZEROERR_ASSERT_CMP | ( | lhs, | |
| op, | |||
| rhs, | |||
| level, | |||
| expect_throw, | |||
| is_false, | |||
| ... ) |
| #define ZEROERR_ASSERT_EQ | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_EXP | ( | cond, | |
| level, | |||
| expect_throw, | |||
| is_false, | |||
| ... ) |
| #define ZEROERR_ASSERT_GE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_GT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_LE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_LT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_NE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_ASSERT_NOT | ( | cond, | |
| ... ) |
| #define ZEROERR_ASSERT_THROWS | ( | cond, | |
| ... ) |
| #define ZEROERR_CHECK | ( | cond, | |
| ... ) |
| #define ZEROERR_CHECK_EQ | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_GE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_GT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_LE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_LEVEL ZEROERR_WARN |
| #define ZEROERR_CHECK_LT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_NE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_CHECK_NOT | ( | cond, | |
| ... ) |
| #define ZEROERR_CHECK_THROWS | ( | cond, | |
| ... ) |
| #define ZEROERR_G_CONTEXT_SCOPE | ( | x | ) |
| #define ZEROERR_PRINT_ASSERT | ( | cond, | |
| level, | |||
| pattern, | |||
| ... ) |
| #define ZEROERR_PRINT_ASSERT_DEFAULT_PRINTER | ( | cond, | |
| level, | |||
| ... ) |
Default printer for assertion messages.
This macro defines the default printer for assertion messages. It prints the assertion message in different colors based on the assertion level.
The macro can be overridden by defining ZEROERR_PRINT_ASSERT_DEFAULT_PRINTER before including this header. (Or undefine it and implement your own printer.)
| #define ZEROERR_REQUIRE | ( | cond, | |
| ... ) |
| #define ZEROERR_REQUIRE_EQ | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_GE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_GT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_LE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_LT | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_NE | ( | lhs, | |
| rhs, | |||
| ... ) |
| #define ZEROERR_REQUIRE_NOT | ( | cond, | |
| ... ) |
| #define ZEROERR_REQUIRE_THROWS | ( | cond, | |
| ... ) |