|
#define | NX_KIT_API |
|
#define | TEST(TEST_CASE, TEST_NAME) ENABLED_TEST(TEST_CASE, TEST_NAME) |
|
#define | ENABLED_TEST(TEST_CASE, TEST_NAME) |
|
#define | DISABLED_TEST(TEST_CASE, TEST_NAME) static void disabled_test_##TEST_CASE##_##TEST_NAME() /* The function will be unused. */ |
|
#define | ASSERT_TRUE(CONDITION) ::nx::kit::test::detail::assertBool(true, !!(CONDITION), #CONDITION, __FILE__, __LINE__) |
|
#define | ASSERT_TRUE_AT_LINE(LINE, CONDITION) ::nx::kit::test::detail::assertBool(true, !!(CONDITION), #CONDITION, __FILE__, LINE, __LINE__) |
|
#define | ASSERT_FALSE(CONDITION) ::nx::kit::test::detail::assertBool(false, !!(CONDITION), #CONDITION, __FILE__, __LINE__) |
|
#define | ASSERT_FALSE_AT_LINE(LINE, CONDITION) ::nx::kit::test::detail::assertBool(false, !!(CONDITION), #CONDITION, __FILE__, LINE, __LINE__) |
|
#define | ASSERT_EQ(EXPECTED, ACTUAL) |
|
#define | ASSERT_EQ_AT_LINE(LINE, EXPECTED, ACTUAL) |
|
#define | ASSERT_STREQ(EXPECTED, ACTUAL) |
|
#define | ASSERT_STREQ_AT_LINE(LINE, EXPECTED, ACTUAL) |
|
|
void | nx::kit::test::assertMultilineTextEquals (const char *file, int line, const std::string &testCaseTag, const std::string &expected, const std::string &actual, const std::string actualSubstrToReplace, const std::string &actualSubstrReplacement) |
|
const char * | nx::kit::test::tempDir () |
|
const char * | nx::kit::test::staticTempDir () |
|
int | nx::kit::test::runAllTests (const char *testSuiteName) |
|
void | nx::kit::test::createFile (const std::string &filename, const std::string &content) |
|
int | nx::kit::test::detail::regTest (const Test &test) |
|
void | nx::kit::test::detail::failEq (const std::string &expectedValue, const char *const expectedExpr, const std::string &actualValue, const char *const actualExpr, const char *const file, int line, int actualLine) |
|
void | nx::kit::test::detail::assertBool (bool expected, bool condition, const char *conditionStr, const char *file, int line, int actualLine) |
|
template<typename Expected , typename Actual > |
void | nx::kit::test::detail::assertEq (const Expected &expected, const char *expectedExpr, const Actual &actual, const char *actualExpr, const char *file, int line, int actualLine=-1) |
|
std::ostream & | nx::kit::test::detail::operator<< (std::ostream &stream, const UniversalString &str) |
|
void | nx::kit::test::detail::assertStrEq (const UniversalString &expectedValue, const char *expectedExpr, const UniversalString &actualValue, const char *actualExpr, const char *file, int line, int actualLine) |
|
Rudimentary standalone unit testing framework designed to mimic Google Test to a certain degree.
NX_KIT_API void nx::kit::test::assertMultilineTextEquals |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const std::string & |
testCaseTag, |
|
|
const std::string & |
expected, |
|
|
const std::string & |
actual, |
|
|
const std::string |
actualSubstrToReplace = "" , |
|
|
const std::string & |
actualSubstrReplacement = "" |
|
) |
| |
Tests that the given string has the expected value, having replaced all occurrences of the given substring with the given replacement (placeholder) - useful when the string being tested contains some substring (e.g. a file name) known only at runtime. Zero bytes inside the strings are supported.
If the strings are not equal, they are treated as multiline via '
' - line-by-line exact comparison is performed, and the different lines are printed. Also for convenience the actual string is printed as a multiline text with line numbers, non-printable chars as '?', and trailing spaces as '#'.
- Parameters
-
actualSubstrToReplace | Must be empty if the replacement is not needed. |
actualSubstrReplacement | Must be empty if the replacement is not needed. |