diff options
Diffstat (limited to 'Tests/Complex/Executable/complex.cxx')
-rw-r--r-- | Tests/Complex/Executable/complex.cxx | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 6b88e85..7d0cb56 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -186,9 +186,11 @@ void TestCMGeneratedFileSTream() std::string file1 = std::string(BINARY_DIR) + std::string("/generatedFile1"); std::string file2 = std::string(BINARY_DIR) + std::string("/generatedFile2"); std::string file3 = std::string(BINARY_DIR) + std::string("/generatedFile3"); + std::string file4 = std::string(BINARY_DIR) + std::string("/generatedFile4"); std::string file1tmp = file1 + ".tmp"; std::string file2tmp = file2 + ".tmp"; std::string file3tmp = file3 + ".tmp"; + std::string file4tmp = file4 + ".tmp"; gm.Open(file1.c_str()); gm << "This is generated file 1"; gm.Close(); @@ -198,32 +200,46 @@ void TestCMGeneratedFileSTream() gm.Open(file3.c_str()); gm << "This is generated file 3"; gm.Close(); + gm.Open(file4.c_str()); + gm << "This is generated file 4"; + gm.Close(); if ( cmSystemTools::FileExists(file1.c_str()) ) { if ( cmSystemTools::FileExists(file2.c_str()) ) { if ( cmSystemTools::FileExists(file3.c_str()) ) { - if ( cmSystemTools::FileExists(file1tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) + if ( cmSystemTools::FileExists(file4.c_str()) ) { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); + if ( cmSystemTools::FileExists(file1tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file4tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file4tmp.c_str()); + } + else + { + cmPassed("cmGeneratedFileStream works."); + } } else { - cmPassed("cmGeneratedFileStream works."); + cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file4.c_str()); } } else { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file3.c_str()); + cmFailed("Something wrong with cmGeneratedFileStream. Found file: ", file3.c_str()); } } else |