diff options
author | KWSys Robot <kwrobot@kitware.com> | 2015-08-03 17:14:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-03 17:17:50 (GMT) |
commit | 9a59ae5c198f7c413bcaf29f1ab107a265677b95 (patch) | |
tree | c904a09ba88c1f96cfb0886c25a25cb1df019075 /testSystemTools.cxx | |
parent | 1feafc643b1c50fd0fa8171a4170065ca39d4d4c (diff) | |
download | CMake-9a59ae5c198f7c413bcaf29f1ab107a265677b95.zip CMake-9a59ae5c198f7c413bcaf29f1ab107a265677b95.tar.gz CMake-9a59ae5c198f7c413bcaf29f1ab107a265677b95.tar.bz2 |
KWSys 2015-08-03 (dad68c33)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ dad68c33 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' f63febb7..dad68c33
James Johnston (1):
dad68c33 Encoding: Fix undefined behavior if out of memory.
Jean-Christophe Fillion-Robin (2):
e5c23738 SystemTools: Fix DetectFileType failure on missing file
6d83c113 SystemTools: Fix DetectFileType failure on directory
Sebastian Schuberth (1):
4db8e69f SystemTools: Implement FileIsSymlink on Windows
Diffstat (limited to 'testSystemTools.cxx')
-rw-r--r-- | testSystemTools.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testSystemTools.cxx b/testSystemTools.cxx index 15d8eab..7b5c025 100644 --- a/testSystemTools.cxx +++ b/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) { |