|
libhatchet
|
Go to the source code of this file.
Classes | |
| class | testing::Test |
Namespaces | |
| namespace | testing |
Macros | |
| #define | TEST(suite_name_, case_name_) |
| #define | TEST_F(suite_fixture_, case_name_) |
| #define | RUN_ALL_TESTS(...) |
| #define | SUCCEED() |
| #define | FAIL() |
| #define | ADD_FAILURE() |
| #define | ADD_FAILURE_AT(file_, line_) |
| #define | EXPECT_TRUE(x_) |
| #define | EXPECT_FALSE(x_) |
| #define | EXPECT_NEAR(expected_, actual_, absolute_range_) |
| #define | EXPECT_LT(a_, b_) |
| #define | EXPECT_GT(a_, b_) |
| #define | EXPECT_LE(a_, b_) |
| #define | EXPECT_GE(a_, b_) |
| #define | EXPECT_EQ(a_, b_) |
| #define | EXPECT_NE(a_, b_) |
| #define | EXPECT_FLOAT_EQ(a_, b_) |
| #define | EXPECT_DOUBLE_EQ(a_, b_) |
| #define | EXPECT_STREQ(a_, b_) |
| #define | EXPECT_STRNE(a_, b_) |
| #define | ASSERT_TRUE(x_) |
| #define | ASSERT_FALSE(x_) |
| #define | ASSERT_NEAR(expected_, actual_, absolute_error_) |
| #define | ASSERT_LT(a_, b_) |
| #define | ASSERT_GT(a_, b_) |
| #define | ASSERT_LE(a_, b_) |
| #define | ASSERT_GE(a_, b_) |
| #define | ASSERT_EQ(a_, b_) |
| #define | ASSERT_NE(a_, b_) |
| #define | ASSERT_FLOAT_EQ(a_, b_) |
| #define | ASSERT_DOUBLE_EQ(a_, b_) |
| #define | ASSERT_STREQ(a_, b_) |
| #define | ASSERT_STRNE(a_, b_) |
Google Test-compatible framework for writing unit tests.
It does not spam your system memory allocator with string operations right after an assert fails. Actually, it never allocates. To disable this header and switch to testing with <gtest/gtest.h> directly, use -DHX_USE_GOOGLE_TEST=1. Only core features are provided. This framework uses only operator< and operator== in its assertions. Compatibility with Google Test may require additional relational operators.
| Macro | Assertion |
|---|---|
| SUCCEED(void) | Marks the current test as successful without any checks. |
| FAIL(void) | WARNING. Calls return. Marks the current test as failed. |
| ADD_FAILURE(void) | Adds a non-fatal failure at the current location. |
| ADD_FAILURE_AT(const char* file, int line) | Adds a non-fatal failure at the specified location. |
| EXPECT_TRUE(bool x) | Requires that the condition is true. |
| EXPECT_FALSE(bool x) | Requires that the condition is false. |
| EXPECT_EQ(T a, T b) | Requires a == b. |
| EXPECT_NE(T a, T b) | Requires a != b using !(a == b). |
| EXPECT_LT(T a, T b) | Requires a < b. |
| EXPECT_GT(T a, T b) | Requires a > b using b < a. |
| EXPECT_LE(T a, T b) | Requires a ≤ b using !(b < a). |
| EXPECT_GE(T a, T b) | Requires a ≥ b using !(a < b). |
| EXPECT_NEAR(T expected, T actual, T absolute_range) | Requires that two values are within a given range. |
| EXPECT_FLOAT_EQ(float a, float b) | Checks floats for equality within a scaled tolerance. |
| EXPECT_DOUBLE_EQ(double a, double b) | Checks doubles for equality within a scaled tolerance. |
| EXPECT_STREQ(const char* a, const char* b) | Requires that two C strings are equal. |
| EXPECT_STRNE(const char* a, const char* b) | Requires that two C strings differ. |
| ASSERT_TRUE(bool x) | Requires that the condition is true. |
| ASSERT_FALSE(bool x) | Requires that the condition is false. |
| ASSERT_EQ(T a, T b) | Requires a == b. |
| ASSERT_NE(T a, T b) | Requires a != b using !(a == b). |
| ASSERT_LT(T a, T b) | Requires a < b. |
| ASSERT_GT(T a, T b) | Requires a > b using b < a. |
| ASSERT_LE(T a, T b) | Requires a ≤ b using !(b < a). |
| ASSERT_GE(T a, T b) | Requires a ≥ b using !(a < b). |
| ASSERT_NEAR(T expected, T actual, T absolute_error) | Requires that two values are within a given range. |
| ASSERT_FLOAT_EQ(float a, float b) | Checks floats for equality within a scaled tolerance. |
| ASSERT_DOUBLE_EQ(double a, double b) | Checks doubles for equality within a scaled tolerance. |
| ASSERT_STREQ(const char* a, const char* b) | Requires that two C strings are equal. |
| ASSERT_STRNE(const char* a, const char* b) | Requires that two C strings differ. |
See: https://google.github.io/googletest/reference/assertions.html
| #define ADD_FAILURE | ( | ) |
void ADD_FAILURE(void) - Adds a non-fatal failure at the current location.
| #define ADD_FAILURE_AT | ( | file_, | |
| line_ ) |
void ADD_FAILURE_AT(const char*, int) - Adds a non-fatal failure at the specified file and line.
| #define ASSERT_DOUBLE_EQ | ( | a_, | |
| b_ ) |
void ASSERT_DOUBLE_EQ(double a, double b) - Requires doubles for equality within a scaled tolerance.
| #define ASSERT_EQ | ( | a_, | |
| b_ ) |
void ASSERT_EQ(T a, T b) - Requires a == b.
| #define ASSERT_FALSE | ( | x_ | ) |
void ASSERT_FALSE(bool) - Requires that the condition is false.
| #define ASSERT_FLOAT_EQ | ( | a_, | |
| b_ ) |
void ASSERT_FLOAT_EQ(float a, float b) - Requires floats for equality within a scaled tolerance.
| #define ASSERT_GE | ( | a_, | |
| b_ ) |
void ASSERT_GE(T a, T b) - Requires a ≥ b using !(a < b).
| #define ASSERT_GT | ( | a_, | |
| b_ ) |
void ASSERT_GT(T a, T b) - Requires a > b using b < a.
| #define ASSERT_LE | ( | a_, | |
| b_ ) |
void ASSERT_LE(T a, T b) - Requires a ≤ b using !(b < a).
| #define ASSERT_LT | ( | a_, | |
| b_ ) |
void ASSERT_LT(T a, T b) - Requires a < b.
| #define ASSERT_NE | ( | a_, | |
| b_ ) |
void ASSERT_NE(T a, T b) - Requires a != b using !(a == b).
| #define ASSERT_NEAR | ( | expected_, | |
| actual_, | |||
| absolute_error_ ) |
void ASSERT_NEAR(T expected, T actual, T absolute_error) - Requires that two values are within a given range.
| #define ASSERT_STREQ | ( | a_, | |
| b_ ) |
void ASSERT_STREQ(const char* a, const char* b) - Requires that two C strings are equal.
| #define ASSERT_STRNE | ( | a_, | |
| b_ ) |
void ASSERT_STRNE(const char* a, const char* b) - Requires that two C strings differ.
| #define ASSERT_TRUE | ( | x_ | ) |
void ASSERT_TRUE(bool) - Requires that the condition is true.
| #define EXPECT_DOUBLE_EQ | ( | a_, | |
| b_ ) |
void EXPECT_DOUBLE_EQ(double a, double b) - Requires doubles for equality within a scaled tolerance.
| #define EXPECT_EQ | ( | a_, | |
| b_ ) |
void EXPECT_EQ(T a, T b) - Requires a == b.
| #define EXPECT_FALSE | ( | x_ | ) |
void EXPECT_FALSE(bool) - Requires that the condition is false.
| #define EXPECT_FLOAT_EQ | ( | a_, | |
| b_ ) |
void EXPECT_FLOAT_EQ(float a, float b) - Requires floats for equality within a scaled tolerance.
| #define EXPECT_GE | ( | a_, | |
| b_ ) |
void EXPECT_GE(T a, T b) - Requires a ≥ b using !(a < b).
| #define EXPECT_GT | ( | a_, | |
| b_ ) |
void EXPECT_GT(T a, T b) - Requires a > b using b < a.
| #define EXPECT_LE | ( | a_, | |
| b_ ) |
void EXPECT_LE(T a, T b) - Requires a ≤ b using !(b < a).
| #define EXPECT_LT | ( | a_, | |
| b_ ) |
void EXPECT_LT(T a, T b) - Requires a < b.
| #define EXPECT_NE | ( | a_, | |
| b_ ) |
void EXPECT_NE(T a, T b) - Requires a != b using !(a == b).
| #define EXPECT_NEAR | ( | expected_, | |
| actual_, | |||
| absolute_range_ ) |
void EXPECT_NEAR(T expected, T actual, T absolute_range) - Requires that two values are within a given range.
| #define EXPECT_STREQ | ( | a_, | |
| b_ ) |
void EXPECT_STREQ(const char* a, const char* b) - Requires that two C strings are equal.
| #define EXPECT_STRNE | ( | a_, | |
| b_ ) |
void EXPECT_STRNE(const char* a, const char* b) - Requires that two C strings differ.
| #define EXPECT_TRUE | ( | x_ | ) |
void EXPECT_TRUE(bool) - Requires that the condition is true.
| #define FAIL | ( | ) |
void FAIL(void) - WARNING.
Calls return. Marks the current test as failed.
| #define RUN_ALL_TESTS | ( | ... | ) |
int RUN_ALL_TESTS(...) - Executes all registered test cases.
| #define SUCCEED | ( | ) |
void SUCCEED(void) - Marks the current test as successful without any checks.
| #define TEST | ( | suite_name_, | |
| case_name_ ) |
TEST(suite_name, case_name) - Google Test reimplementation.
Defines a test case with a suite name and case name.
| #define TEST_F | ( | suite_fixture_, | |
| case_name_ ) |
TEST_F(suite_name, case_name) - Google Test reimplementation for fixture-based tests.
Defines a test case where the suite_name is a subclass of testing::Test.