diff options
Diffstat (limited to 'Source/kwsys/testSystemTools.cxx')
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 15d8eab..7b5c025 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -98,6 +98,10 @@ static bool CheckEscapeChars(kwsys_stl::string input, static bool CheckFileOperations() { bool res = true; + const kwsys_stl::string testNonExistingFile(TEST_SYSTEMTOOLS_SOURCE_DIR + "/testSystemToolsNonExistingFile"); + const kwsys_stl::string testDotFile(TEST_SYSTEMTOOLS_SOURCE_DIR + "/."); const kwsys_stl::string testBinFile(TEST_SYSTEMTOOLS_SOURCE_DIR "/testSystemTools.bin"); const kwsys_stl::string testTxtFile(TEST_SYSTEMTOOLS_SOURCE_DIR @@ -106,6 +110,24 @@ static bool CheckFileOperations() "/testSystemToolsNewDir"); const kwsys_stl::string testNewFile(testNewDir + "/testNewFile.txt"); + if (kwsys::SystemTools::DetectFileType(testNonExistingFile.c_str()) != + kwsys::SystemTools::FileTypeUnknown) + { + kwsys_ios::cerr + << "Problem with DetectFileType - failed to detect type of: " + << testNonExistingFile << kwsys_ios::endl; + res = false; + } + + if (kwsys::SystemTools::DetectFileType(testDotFile.c_str()) != + kwsys::SystemTools::FileTypeUnknown) + { + kwsys_ios::cerr + << "Problem with DetectFileType - failed to detect type of: " + << testDotFile << kwsys_ios::endl; + res = false; + } + if (kwsys::SystemTools::DetectFileType(testBinFile.c_str()) != kwsys::SystemTools::FileTypeBinary) { |