diff options
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r-- | Tests/CMakeLib/testString.cxx | 12 | ||||
-rw-r--r-- | Tests/CMakeLib/testSystemTools.cxx | 12 |
2 files changed, 13 insertions, 11 deletions
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx index 2aa1459..af5e41e 100644 --- a/Tests/CMakeLib/testString.cxx +++ b/Tests/CMakeLib/testString.cxx @@ -16,10 +16,12 @@ #include <utility> #define ASSERT_TRUE(x) \ - if (!(x)) { \ - std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \ - return false; \ - } + do { \ + if (!(x)) { \ + std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \ + return false; \ + } \ + } while (false) static bool testConstructDefault() { @@ -144,7 +146,6 @@ static bool testConstructFromCStr() { std::cout << "testConstructFromCStr()\n"; return testFromCStr(cstr); - ; } static bool testAssignFromCStr() @@ -153,7 +154,6 @@ static bool testAssignFromCStr() cm::String str; str = cstr; return testFromCStr(str); - ; } static const std::string stdstr = "abc"; diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index 623ad28..96a4819 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -16,11 +16,13 @@ failed = 1 #define cmAssert(exp, m) \ - if ((exp)) { \ - cmPassed(m); \ - } else { \ - cmFailed(m); \ - } + do { \ + if ((exp)) { \ + cmPassed(m); \ + } else { \ + cmFailed(m); \ + } \ + } while (false) int testSystemTools(int /*unused*/, char* /*unused*/ []) { |