diff options
Diffstat (limited to 'Source/cmSetTestsPropertiesCommand.cxx')
| -rw-r--r-- | Source/cmSetTestsPropertiesCommand.cxx | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index e66d13d..53dc5a8 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -26,40 +26,25 @@ bool cmSetTestsPropertiesCommand // first collect up the list of files std::vector<std::string> propertyPairs; - bool doingFiles = true; int numFiles = 0; std::vector<std::string>::const_iterator j; for(j= args.begin(); j != args.end();++j) { if(*j == "PROPERTIES") { - doingFiles = false; // now loop through the rest of the arguments, new style ++j; - while (j != args.end()) + if (std::distance(j, args.end()) % 2 != 0) { - propertyPairs.push_back(*j); - ++j; - if(j == args.end()) - { - this->SetError("called with incorrect number of arguments."); - return false; - } - propertyPairs.push_back(*j); - ++j; + this->SetError("called with incorrect number of arguments."); + return false; } - // break out of the loop because j is already == end + propertyPairs.insert(propertyPairs.end(), j, args.end()); break; } - else if (doingFiles) - { - numFiles++; - } else { - this->SetError("called with illegal arguments, maybe " - "missing a PROPERTIES specifier?"); - return false; + numFiles++; } } if(propertyPairs.empty()) @@ -69,7 +54,6 @@ bool cmSetTestsPropertiesCommand return false; } - // now loop over all the targets int i; for(i = 0; i < numFiles; ++i) @@ -101,8 +85,10 @@ bool cmSetTestsPropertiesCommand unsigned int k; for (k = 0; k < propertyPairs.size(); k = k + 2) { - test->SetProperty(propertyPairs[k], - propertyPairs[k+1].c_str()); + if (!propertyPairs[k].empty()) + { + test->SetProperty(propertyPairs[k], propertyPairs[k+1].c_str()); + } } } else |
