summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testCommandLineArguments.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-14 12:38:40 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-14 12:38:40 (GMT)
commit0d887397367b4b8c01a584e8e1a4b3192ca7af18 (patch)
tree8e272eb11c02793d0983e908e2524df93583685d /Source/kwsys/testCommandLineArguments.cxx
parent848dc85187ec1e4b2364987d911ce7af93062b45 (diff)
parenta4841e12c0e3865a585774b118e7b9840bc1b253 (diff)
downloadCMake-0d887397367b4b8c01a584e8e1a4b3192ca7af18.zip
CMake-0d887397367b4b8c01a584e8e1a4b3192ca7af18.tar.gz
CMake-0d887397367b4b8c01a584e8e1a4b3192ca7af18.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2019-01-14 (1541d849)
Diffstat (limited to 'Source/kwsys/testCommandLineArguments.cxx')
-rw-r--r--Source/kwsys/testCommandLineArguments.cxx35
1 files changed, 18 insertions, 17 deletions
diff --git a/Source/kwsys/testCommandLineArguments.cxx b/Source/kwsys/testCommandLineArguments.cxx
index ef87436..15f9c02 100644
--- a/Source/kwsys/testCommandLineArguments.cxx
+++ b/Source/kwsys/testCommandLineArguments.cxx
@@ -165,25 +165,26 @@ int testCommandLineArguments(int argc, char* argv[])
}
size_t cc;
#define CompareTwoLists(list1, list_valid, lsize) \
- if (list1.size() != lsize) { \
- std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
- << " should be: " << lsize << std::endl; \
- res = 1; \
- } else { \
- std::cout << #list1 " argument set:"; \
- for (cc = 0; cc < lsize; ++cc) { \
- std::cout << " " << list1[cc]; \
- if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
- std::cerr << "Problem setting " #list1 ". Value of " << cc \
- << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
- << "]" << std::endl; \
- res = 1; \
- break; \
+ do { \
+ if (list1.size() != lsize) { \
+ std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
+ << " should be: " << lsize << std::endl; \
+ res = 1; \
+ } else { \
+ std::cout << #list1 " argument set:"; \
+ for (cc = 0; cc < lsize; ++cc) { \
+ std::cout << " " << list1[cc]; \
+ if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
+ std::cerr << "Problem setting " #list1 ". Value of " << cc \
+ << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
+ << "]" << std::endl; \
+ res = 1; \
+ break; \
+ } \
} \
+ std::cout << std::endl; \
} \
- std::cout << std::endl; \
- }
-
+ } while (0)
CompareTwoLists(numbers_argument, valid_numbers, 10);
CompareTwoLists(doubles_argument, valid_doubles, 3);
CompareTwoLists(bools_argument, valid_bools, 3);