Macros | |
| #define | PW_CONSTEXPR_TEST(test_suite, test_name, ...) |
| #define | PW_CONSTEXPR_TEST_IF_CLANG(test_suite, test_case, ...) |
| #define | PW_CONSTEXPR_TEST_IF_GCC(test_suite, test_case, ...) |
| #define | PW_TEST_EXPECT_TRUE(expr) _PW_CEXPECT(TRUE, expr) |
| #define | PW_TEST_EXPECT_FALSE(expr) _PW_CEXPECT(FALSE, expr) |
| #define | PW_TEST_EXPECT_EQ(lhs, rhs) _PW_CEXPECT(EQ, lhs, rhs) |
| #define | PW_TEST_EXPECT_NE(lhs, rhs) _PW_CEXPECT(NE, lhs, rhs) |
| #define | PW_TEST_EXPECT_GT(lhs, rhs) _PW_CEXPECT(GT, lhs, rhs) |
| #define | PW_TEST_EXPECT_GE(lhs, rhs) _PW_CEXPECT(GE, lhs, rhs) |
| #define | PW_TEST_EXPECT_LT(lhs, rhs) _PW_CEXPECT(LT, lhs, rhs) |
| #define | PW_TEST_EXPECT_LE(lhs, rhs) _PW_CEXPECT(LE, lhs, rhs) |
| #define | PW_TEST_EXPECT_NEAR(lhs, rhs, error) _PW_CEXPECT(NEAR, lhs, rhs, error) |
| #define | PW_TEST_EXPECT_FLOAT_EQ(lhs, rhs) _PW_CEXPECT(FLOAT_EQ, lhs, rhs) |
| #define | PW_TEST_EXPECT_DOUBLE_EQ(lhs, rhs) _PW_CEXPECT(DOUBLE_EQ, lhs, rhs) |
| #define | PW_TEST_EXPECT_STREQ(lhs, rhs) _PW_CEXPECT(STREQ, lhs, rhs) |
| #define | PW_TEST_EXPECT_STRNE(lhs, rhs) _PW_CEXPECT(STRNE, lhs, rhs) |
| #define | PW_TEST_ASSERT_TRUE(expr) _PW_CASSERT(TRUE, expr) |
| #define | PW_TEST_ASSERT_FALSE(expr) _PW_CASSERT(FALSE, expr) |
| #define | PW_TEST_ASSERT_EQ(lhs, rhs) _PW_CASSERT(EQ, lhs, rhs) |
| #define | PW_TEST_ASSERT_NE(lhs, rhs) _PW_CASSERT(NE, lhs, rhs) |
| #define | PW_TEST_ASSERT_GT(lhs, rhs) _PW_CASSERT(GT, lhs, rhs) |
| #define | PW_TEST_ASSERT_GE(lhs, rhs) _PW_CASSERT(GE, lhs, rhs) |
| #define | PW_TEST_ASSERT_LT(lhs, rhs) _PW_CASSERT(LT, lhs, rhs) |
| #define | PW_TEST_ASSERT_LE(lhs, rhs) _PW_CASSERT(LE, lhs, rhs) |
| #define | PW_TEST_ASSERT_NEAR(lhs, rhs, error) _PW_CASSERT(NEAR, lhs, rhs, error) |
| #define | PW_TEST_ASSERT_FLOAT_EQ(lhs, rhs) _PW_CASSERT(FLOAT_EQ, lhs, rhs) |
| #define | PW_TEST_ASSERT_DOUBLE_EQ(lhs, rhs) _PW_CASSERT(DOUBLE_EQ, lhs, rhs) |
| #define | PW_TEST_ASSERT_STREQ(lhs, rhs) _PW_CASSERT(STREQ, lhs, rhs) |
| #define | PW_TEST_ASSERT_STRNE(lhs, rhs) _PW_CASSERT(STRNE, lhs, rhs) |
| #define PW_CONSTEXPR_TEST | ( | test_suite, | |
| test_name, | |||
| ... | |||
| ) |
Defines a test that is executed both at compile time in a static_assert and as a regular GoogleTest-style TEST().
PW_CONSTEXPR_TEST works similarly to the GoogleTest TEST() macro, but has some differences.
constexpr.PW_TEST_* prefixed versions of GoogleTest's EXPECT_* and ASSERT_* macros.#define. If these are needed, move them to a separate function that is called from the test.PW_CONSTEXPR_TEST macro must be terminated with ); after the test body argument.| test_suite | GoogleTest test suite name |
| test_name | GoogleTest test name |
| ... | test function body surrounded by { }. |
| #define PW_CONSTEXPR_TEST_IF_CLANG | ( | test_suite, | |
| test_case, | |||
| ... | |||
| ) |
Like PW_CONSTEXPR_TEST, but only executes at compile time when using Clang.
In theory, different compilers should be able to constant-evaluate the same expressions. In practice, however, discrepancies and defects may result in some expressions only being constexpr for a particular compiler.
| #define PW_CONSTEXPR_TEST_IF_GCC | ( | test_suite, | |
| test_case, | |||
| ... | |||
| ) |
Like PW_CONSTEXPR_TEST, but only executes at compile time when using GCC.
In theory, different compilers should be able to constant-evaluate the same expressions. In practice, however, discrepancies and defects may result in some expressions only being constexpr for a particular compiler.