summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-16 14:52:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-16 14:52:45 (GMT)
commitbd54cc774a5b14720a9e741fc40192ea11106443 (patch)
treef8d0bab5ca429938678e74af746ee9ab0ccdd778 /Tests
parente2c39e05732409d60e7921b45a70dd8b9aa24b5a (diff)
parentb056bc34258267c4ae59c72e3777d0a0f0b5a1b1 (diff)
downloadCMake-bd54cc774a5b14720a9e741fc40192ea11106443.zip
CMake-bd54cc774a5b14720a9e741fc40192ea11106443.tar.gz
CMake-bd54cc774a5b14720a9e741fc40192ea11106443.tar.bz2
Merge topic 'semi-warnings'
b056bc3425 Fix most clang -Wextra-semi-stmt warnings in C++ files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2795
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/testString.cxx12
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx12
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*/ [])
{