summaryrefslogtreecommitdiff
path: root/Source/cmCreateTestSourceList.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCreateTestSourceList.cxx')
-rw-r--r--Source/cmCreateTestSourceList.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index cf086ae455..ac9b3a2b60 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -194,7 +194,7 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
" p = new_string;\n"
" while (*p != 0)\n"
" {\n"
- " *p = tolower(*p);\n"
+ " *p = (char)tolower(*p);\n"
" ++p;\n"
" }\n"
" return new_string;\n"
@@ -202,7 +202,7 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
"\n"
"int main(int ac, char *av[])\n"
"{\n"
- " int NumTests, i, testNum, partial_match;\n"
+ " int i, testNum, partial_match;\n"
" char *arg, *test_name;\n"
" \n"
" NumTests = " << numTests << ";\n"
@@ -217,12 +217,6 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
fout <<
" if (ac < 2)\n"
" {\n"
- " // If there is only one test, then run it with the arguments\n"
- " if (NumTests == 1)\n"
- " {\n"
- " return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av);\n"
- " }\n"
- " \n"
" // Ask for a test\n"
" printf(\"Available tests:\\n\");\n"
" for (i =0; i < NumTests; ++i)\n"
@@ -254,23 +248,18 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
" test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);\n"
" if (partial_match && strstr(test_name, arg) != NULL)\n"
" {\n"
+ " free(test_name);\n"
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 2, av + 2);\n"
" }\n"
" else if (!partial_match && strcmp(test_name, arg) == 0)\n"
" {\n"
+ " free(test_name);\n"
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 1, av + 1);\n"
" }\n"
" free(test_name);\n"
" }\n"
" free(arg);\n"
" \n"
- " // If the test was not found but there is only one test, then\n"
- " // run it with the arguments\n"
- " if (NumTests == 1)\n"
- " {\n"
- " return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av);\n"
- " }\n"
- " \n"
" // Nothing was run, display the test names\n"
" printf(\"Available tests:\\n\");\n"
" for (i =0; i < NumTests; ++i)\n"