summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-29 13:22:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-11-29 13:22:15 (GMT)
commit04f869bb4645aae8171f70746898ca20d3c05be1 (patch)
treeacffb44f5b1ff388a9215ad79b3ba15b3ae9b85c
parent89a628e28f68daf124129aa1810ba50a420a64c2 (diff)
parent72d3161a7f5d350d848d5b44cf343bac19e22238 (diff)
downloadCMake-04f869bb4645aae8171f70746898ca20d3c05be1.zip
CMake-04f869bb4645aae8171f70746898ca20d3c05be1.tar.gz
CMake-04f869bb4645aae8171f70746898ca20d3c05be1.tar.bz2
Merge topic 'cppcheck_testdriver'
72d3161a TestDriver: fix style-'variableScope' cppcheck warning Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1518
-rw-r--r--Templates/TestDriver.cxx.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index bf61be4..ff3c869 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -58,7 +58,7 @@ static char* lowercase(const char* string)
int main(int ac, char* av[])
{
int i, testNum = 0, partial_match;
- char *arg, *test_name;
+ char *arg;
int testToRun = -1;
@CMAKE_TESTDRIVER_ARGVC_FUNCTION@
@@ -99,7 +99,7 @@ int main(int ac, char* av[])
arg = lowercase(av[1 + partial_match]);
}
for (i = 0; i < NumTests && testToRun == -1; ++i) {
- test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
+ char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
if (partial_match != 0 && strstr(test_name, arg) != NULL) { /* NOLINT */
testToRun = i;
ac -= 2;