|
bool | expectAllReached (uint32_t expected_reached, const uint32_t line, const char *file) |
|
bool | expect (bool val, const char *test_type, const uint32_t line, const char *file) |
|
bool | expectEqual (uint8_t v1, uint8_t v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
|
template<typename T > |
bool | expectEqual (const T &v1, const T &v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
|
template<typename T , typename U = T> |
bool | expectEqual (const T &v1, const U &v2, bool expected, const char *test_type, const uint32_t line, const char *file) |
|
template<typename T , typename U > |
std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value &&(std::is_signed< T >::value!=std::is_signed< U >::value), bool >::type | compare (const T &t, const U &u) |
|
template<typename T , typename U > |
std::enable_if<!(std::is_integral< T >::value &&std::is_integral< U >::value &&(std::is_signed< T >::value!=std::is_signed< U >::value)), bool >::type | compare (const T &t, const U &u) |
|
template<typename T > |
bool | expectEqual (const T &v1, const std::nullptr_t, bool expected, const char *test_type, const uint32_t line, const char *file) |
|
template<typename T > |
bool | expectEqual (const std::nullptr_t, const T &v1, bool expected, const char *test_type, const uint32_t line, const char *file) |
|
template<typename T > |
std::enable_if< std::is_floating_point< T >::value, bool >::type | expectEqualWithinTolerance (const T &v1, const T &v2, const T &tol, const char *test_type, const uint32_t line, const char *file) |
|
void | throwTestFailed (const char *test_type, const uint32_t line, const char *file, const char *exception_what="") |
|
void | expectFilesEqual (const std::string &a, const std::string &b, bool expected, uint32_t line, const char *file, const bool ignore_commented_lines=true) |
| Compares two files.
|
|
void | fileComparisonFailed (const std::string &a, const std::string &b, const uint32_t line, const char *file, const std::string &error) |
|
void | reachedMethod (const std::string &method_title) |
|
A simple testing class.
The user of this framework should not have to instantiate this class directly. You can if you want to, but you should use the TEST_INIT macro.
Example usage:
int main() {
}
#define EXPECT_FALSE(x)
Determine if the block x evaluates to false.
#define EXPECT_NOTHROW(x)
Determine if the block x throws an exception incorrectly.
#define EXPECT_NOTEQUAL(x, y)
Determine if the block x is not equal (using operator= on x) to y.
#define EXPECT_TRUE(x)
Determine if the block x evaluates to true.
#define EXPECT_EQUAL(x, y)
Determine if the block x is equal (using operator= on x) to y.
#define TEST_INIT
Initialized the test. Should be placed OUTSIDE of a code block SOMEWHERE in the test source.
#define EXPECT_THROW(x)
Determine if the block x correctly throws an exception.
#define REPORT_ERROR
Prints the error code with a nice pretty message.
#define ERROR_CODE
The number of errors found in the testing.
Definition at line 51 of file SpartaTester.hpp.