summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-07-30 14:23:39 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-07-30 14:23:39 (GMT)
commitf87057813da84451aa60e85d3992b89e1f3c7bb0 (patch)
treee17e997bb37f42fca5f13f9dc7d873fb1906e3dc /Source
parent7dffa485f6316185fed1e8732501325fe336a54c (diff)
downloadCMake-f87057813da84451aa60e85d3992b89e1f3c7bb0.zip
CMake-f87057813da84451aa60e85d3992b89e1f3c7bb0.tar.gz
CMake-f87057813da84451aa60e85d3992b89e1f3c7bb0.tar.bz2
FIX: la commande créait du code C++. Du code C devrait faire l'affaire.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCreateTestSourceList.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index e8643ab..74279fe 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -159,13 +159,14 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
"\n"
"char* lowercase(const char *string)\n"
"{\n"
- " char *new_string = new char[strlen(string) + 1];\n"
+ " char *new_string, *p;\n"
+ " new_string = new char[strlen(string) + 1];\n"
" if (!new_string)\n"
" {\n"
" return NULL;\n"
" }\n"
" strcpy(new_string, string);\n"
- " char *p = new_string;\n"
+ " p = new_string;\n"
" while (*p != 0)\n"
" {\n"
" *p = tolower(*p);\n"
@@ -176,8 +177,10 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
"\n"
"int main(int ac, char** av)\n"
"{\n"
- " int NumTests = " << numTests << ";\n"
- " int i;\n"
+ " int NumTests, i, testNum, partial_match;\n"
+ " char *arg, *test_name;\n"
+ " \n"
+ " NumTests = " << numTests << ";\n"
" \n"
" // If no test name was given\n";
if(function.size())
@@ -202,7 +205,7 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
" printf(\"%3d. %s\\n\", i, cmakeGeneratedFunctionMapEntries[i].name);\n"
" }\n"
" printf(\"To run a test, enter the test number: \");\n"
- " int testNum = 0;\n"
+ " testNum = 0;\n"
" scanf(\"%d\", &testNum);\n"
" if (testNum >= NumTests)\n"
" {\n"
@@ -213,17 +216,17 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
" }\n"
" \n"
" // If partial match is requested\n"
- " int partial_match = (strcmp(av[1], \"-R\") == 0) ? 1 : 0;\n"
+ " partial_match = (strcmp(av[1], \"-R\") == 0) ? 1 : 0;\n"
" if (partial_match && ac < 3)\n"
" {\n"
" printf(\"-R needs an additional parameter.\\n\");\n"
" return -1;\n"
" }\n"
" \n"
- " char *arg = lowercase(av[1 + partial_match]);\n"
+ " arg = lowercase(av[1 + partial_match]);\n"
" for (i =0; i < NumTests; ++i)\n"
" {\n"
- " char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);\n"
+ " test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);\n"
" if (partial_match && strstr(test_name, arg) != NULL)\n"
" {\n"
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 2, av + 2);\n"