diff options
Diffstat (limited to 'lib/common/Test.h')
-rw-r--r-- | lib/common/Test.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/common/Test.h b/lib/common/Test.h index 146fafae..be481ddd 100644 --- a/lib/common/Test.h +++ b/lib/common/Test.h @@ -146,7 +146,7 @@ extern std::list<std::string> run_only_named_tests; } \ } -// utility macro for testing a line +// utility macros for testing a string/output line #define TEST_LINE(_condition, _line) \ TEST_THAT(_condition); \ if (!(_condition)) \ @@ -157,6 +157,13 @@ extern std::list<std::string> run_only_named_tests; printf("Test failed on <%s>\n", _line_str.c_str()); \ } +#define TEST_LINE_OR(_condition, _line, _or_command) \ + TEST_LINE(_condition, _line); \ + if(!(_condition)) \ + { \ + _or_command; \ + } + #define TEST_STARTSWITH(expected, actual) \ TEST_EQUAL_LINE(expected, actual.substr(0, std::string(expected).size()), actual); |