diff --git a/test/macro.h b/test/macro.h index 8da47d1..e38a92b 100644 --- a/test/macro.h +++ b/test/macro.h @@ -4,6 +4,14 @@ #include // fprintf #include // cerr +#define VERIFY(x) \ + if (!(x)) { \ + fprintf(stderr, " \033[31;1mFAIL:\033[0m %s:%d: VERIFY(%s) failed\n", \ + __FILE__, __LINE__, #x); \ + Test::TestSuite::the().currentTestCaseFailed(); \ + return; \ + } + #define EXPECT(x) \ if (!(x)) { \ fprintf(stderr, " \033[31;1mFAIL:\033[0m %s:%d: EXPECT(%s) failed\n", \ diff --git a/test/testdotfile.cpp b/test/testdotfile.cpp index c4498a2..aab50af 100644 --- a/test/testdotfile.cpp +++ b/test/testdotfile.cpp @@ -23,7 +23,7 @@ const size_t homeDirectorySize = homeDirectory.size(); void createTestDotfiles(const std::vector& fileNames, const std::vector& fileContents) { - EXPECT_EQ(fileNames.size(), fileContents.size()); + VERIFY(fileNames.size() == fileContents.size()); for (size_t i = 0; i < fileNames.size(); ++i) { auto fileName = fileNames.at(i);