summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-02 14:23:17 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-02 14:23:17 (GMT)
commitc5cc3441b379e2bc6e70efd6dbd530edebbf0024 (patch)
treede0c2a39648c936039b7c86886cbe49c04b92923 /Source/kwsys/testSystemTools.cxx
parent72c11e590273d100c49f472afc3a7569b233ff00 (diff)
parent1b79433a6d7cdd1da1a0af74240f2299c78e4112 (diff)
downloadCMake-c5cc3441b379e2bc6e70efd6dbd530edebbf0024.zip
CMake-c5cc3441b379e2bc6e70efd6dbd530edebbf0024.tar.gz
CMake-c5cc3441b379e2bc6e70efd6dbd530edebbf0024.tar.bz2
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/testSystemTools.cxx')
-rw-r--r--Source/kwsys/testSystemTools.cxx305
1 files changed, 152 insertions, 153 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index bc9ca5e..e14d2fc 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -16,19 +16,18 @@
#endif
#include KWSYS_HEADER(SystemTools.hxx)
-#include KWSYS_HEADER(ios/iostream)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "SystemTools.hxx.in"
-# include "kwsys_ios_iostream.h.in"
#endif
// Include with <> instead of "" to avoid getting any in-source copy
// left on disk.
#include <testSystemTools.h>
+#include <iostream>
#include <string.h> /* strcmp */
#if defined(_WIN32) && !defined(__CYGWIN__)
# include <io.h> /* _umask (MSVC) / umask (Borland) */
@@ -63,17 +62,17 @@ static const char* toUnixPaths[][2] =
{0, 0}
};
-static bool CheckConvertToUnixSlashes(kwsys_stl::string input,
- kwsys_stl::string output)
+static bool CheckConvertToUnixSlashes(std::string input,
+ std::string output)
{
- kwsys_stl::string result = input;
+ std::string result = input;
kwsys::SystemTools::ConvertToUnixSlashes(result);
if ( result != output )
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToUnixSlashes - input: " << input
<< " output: " << result << " expected: " << output
- << kwsys_ios::endl;
+ << std::endl;
return false;
}
return true;
@@ -87,19 +86,19 @@ static const char* checkEscapeChars[][4] =
{0, 0, 0, 0}
};
-static bool CheckEscapeChars(kwsys_stl::string input,
+static bool CheckEscapeChars(std::string input,
const char *chars_to_escape,
char escape_char,
- kwsys_stl::string output)
+ std::string output)
{
- kwsys_stl::string result = kwsys::SystemTools::EscapeChars(
+ std::string result = kwsys::SystemTools::EscapeChars(
input.c_str(), chars_to_escape, escape_char);
if (result != output)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CheckEscapeChars - input: " << input
<< " output: " << result << " expected: " << output
- << kwsys_ios::endl;
+ << std::endl;
return false;
}
return true;
@@ -109,75 +108,75 @@ static bool CheckEscapeChars(kwsys_stl::string input,
static bool CheckFileOperations()
{
bool res = true;
- const kwsys_stl::string testNonExistingFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testNonExistingFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemToolsNonExistingFile");
- const kwsys_stl::string testDotFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testDotFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/.");
- const kwsys_stl::string testBinFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testBinFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemTools.bin");
- const kwsys_stl::string testTxtFile(TEST_SYSTEMTOOLS_SOURCE_DIR
+ const std::string testTxtFile(TEST_SYSTEMTOOLS_SOURCE_DIR
"/testSystemTools.cxx");
- const kwsys_stl::string testNewDir(TEST_SYSTEMTOOLS_BINARY_DIR
+ const std::string testNewDir(TEST_SYSTEMTOOLS_BINARY_DIR
"/testSystemToolsNewDir");
- const kwsys_stl::string testNewFile(testNewDir + "/testNewFile.txt");
+ const std::string testNewFile(testNewDir + "/testNewFile.txt");
if (kwsys::SystemTools::DetectFileType(testNonExistingFile.c_str()) !=
kwsys::SystemTools::FileTypeUnknown)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testNonExistingFile << kwsys_ios::endl;
+ << testNonExistingFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testDotFile.c_str()) !=
kwsys::SystemTools::FileTypeUnknown)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testDotFile << kwsys_ios::endl;
+ << testDotFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testBinFile.c_str()) !=
kwsys::SystemTools::FileTypeBinary)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testBinFile << kwsys_ios::endl;
+ << testBinFile << std::endl;
res = false;
}
if (kwsys::SystemTools::DetectFileType(testTxtFile.c_str()) !=
kwsys::SystemTools::FileTypeText)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DetectFileType - failed to detect type of: "
- << testTxtFile << kwsys_ios::endl;
+ << testTxtFile << std::endl;
res = false;
}
if (kwsys::SystemTools::FileLength(testBinFile) != 766)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with FileLength - incorrect length for: "
- << testBinFile << kwsys_ios::endl;
+ << testBinFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::MakeDirectory(testNewDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with MakeDirectory for: "
- << testNewDir << kwsys_ios::endl;
+ << testNewDir << std::endl;
res = false;
}
if (!kwsys::SystemTools::Touch(testNewFile.c_str(), true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Touch for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
@@ -195,34 +194,34 @@ static bool CheckFileOperations()
mode_t origPerm, thisPerm;
if (!kwsys::SystemTools::GetPermissions(testNewFile, origPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (1) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::SetPermissions(testNewFile, 0))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (1) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (2) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != 0)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to set permissions (1) for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << 0 << kwsys_ios::endl;
+ << 0 << std::endl;
res = false;
}
@@ -230,70 +229,70 @@ static bool CheckFileOperations()
if (kwsys::SystemTools::TestFileAccess(testNewFile,
kwsys::TEST_FILE_WRITE))
{
- kwsys_ios::cerr
+ std::cerr
<< "TestFileAccess incorrectly indicated that this is a writable file:"
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::TestFileAccess(testNewFile,
kwsys::TEST_FILE_OK))
{
- kwsys_ios::cerr
+ std::cerr
<< "TestFileAccess incorrectly indicated that this file does not exist:"
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
// Test restoring/setting full permissions.
if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (2) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (3) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != fullMask)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to set permissions (2) for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << fullMask << kwsys_ios::endl;
+ << fullMask << std::endl;
res = false;
}
// Test setting file permissions while honoring umask
if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask, true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (3) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with GetPermissions (4) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
if ((thisPerm & fullMask) != 0)
{
- kwsys_ios::cerr
+ std::cerr
<< "SetPermissions failed to honor umask for: "
<< testNewFile << ": actual = " << thisPerm << "; expected = "
- << 0 << kwsys_ios::endl;
+ << 0 << std::endl;
res = false;
}
@@ -303,35 +302,35 @@ static bool CheckFileOperations()
// Restore file permissions
if (!kwsys::SystemTools::SetPermissions(testNewFile, origPerm))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with SetPermissions (4) for: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
// Remove the test file
if (!kwsys::SystemTools::RemoveFile(testNewFile))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveFile: "
- << testNewFile << kwsys_ios::endl;
+ << testNewFile << std::endl;
res = false;
}
- kwsys_stl::string const testFileMissing(testNewDir + "/testMissingFile.txt");
+ std::string const testFileMissing(testNewDir + "/testMissingFile.txt");
if (!kwsys::SystemTools::RemoveFile(testFileMissing))
{
std::string const& msg = kwsys::SystemTools::GetLastSystemError();
- kwsys_ios::cerr <<
+ std::cerr <<
"RemoveFile(\"" << testFileMissing << "\") failed: " << msg << "\n";
res = false;
}
- kwsys_stl::string const testFileMissingDir(testNewDir + "/missing/file.txt");
+ std::string const testFileMissingDir(testNewDir + "/missing/file.txt");
if (!kwsys::SystemTools::RemoveFile(testFileMissingDir))
{
std::string const& msg = kwsys::SystemTools::GetLastSystemError();
- kwsys_ios::cerr <<
+ std::cerr <<
"RemoveFile(\"" << testFileMissingDir << "\") failed: " << msg << "\n";
res = false;
}
@@ -339,9 +338,9 @@ static bool CheckFileOperations()
kwsys::SystemTools::Touch(testNewFile.c_str(), true);
if (!kwsys::SystemTools::RemoveADirectory(testNewDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveADirectory for: "
- << testNewDir << kwsys_ios::endl;
+ << testNewDir << std::endl;
res = false;
}
@@ -349,14 +348,14 @@ static bool CheckFileOperations()
// Perform the same file and directory creation and deletion tests but
// with paths > 256 characters in length.
- const kwsys_stl::string testNewLongDir(
+ const std::string testNewLongDir(
TEST_SYSTEMTOOLS_BINARY_DIR "/"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"01234567890123");
- const kwsys_stl::string testNewLongFile(testNewLongDir + "/"
+ const std::string testNewLongFile(testNewLongDir + "/"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
"012345678901234567890123456789012345678901234567890123456789"
@@ -365,34 +364,34 @@ static bool CheckFileOperations()
if (!kwsys::SystemTools::MakeDirectory(testNewLongDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with MakeDirectory for: "
- << testNewLongDir << kwsys_ios::endl;
+ << testNewLongDir << std::endl;
res = false;
}
if (!kwsys::SystemTools::Touch(testNewLongFile.c_str(), true))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Touch for: "
- << testNewLongFile << kwsys_ios::endl;
+ << testNewLongFile << std::endl;
res = false;
}
if (!kwsys::SystemTools::RemoveFile(testNewLongFile))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveFile: "
- << testNewLongFile << kwsys_ios::endl;
+ << testNewLongFile << std::endl;
res = false;
}
kwsys::SystemTools::Touch(testNewLongFile.c_str(), true);
if (!kwsys::SystemTools::RemoveADirectory(testNewLongDir))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveADirectory for: "
- << testNewLongDir << kwsys_ios::endl;
+ << testNewLongDir << std::endl;
res = false;
}
#endif
@@ -405,12 +404,12 @@ static bool CheckStringOperations()
{
bool res = true;
- kwsys_stl::string test = "mary had a little lamb.";
+ std::string test = "mary had a little lamb.";
if (kwsys::SystemTools::CapitalizedWords(test) != "Mary Had A Little Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -418,9 +417,9 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::UnCapitalizedWords(test) !=
"mary had a little lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with UnCapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -428,9 +427,9 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::AddSpaceBetweenCapitalizedWords(test) !=
"Mary Had The Little Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AddSpaceBetweenCapitalizedWords "
- << '"' << test << '"' << kwsys_ios::endl;
+ << '"' << test << '"' << std::endl;
res = false;
}
@@ -438,9 +437,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::AppendStrings("Mary Had A"," Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AppendStrings "
- << "\"Mary Had A\" \" Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A\" \" Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -449,18 +448,18 @@ static bool CheckStringOperations()
kwsys::SystemTools::AppendStrings("Mary Had"," A ","Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with AppendStrings "
- << "\"Mary Had\" \" A \" \"Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had\" \" A \" \"Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
if (kwsys::SystemTools::CountChar("Mary Had A Little Lamb.",'a') != 3)
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CountChar "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
@@ -468,9 +467,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::RemoveChars("Mary Had A Little Lamb.","aeiou");
if (strcmp(cres,"Mry Hd A Lttl Lmb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveChars "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -479,9 +478,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::RemoveCharsButUpperHex("Mary Had A Little Lamb.");
if (strcmp(cres,"A"))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with RemoveCharsButUpperHex "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -491,9 +490,9 @@ static bool CheckStringOperations()
kwsys::SystemTools::ReplaceChars(cres2,"aeiou",'X');
if (strcmp(cres2,"MXry HXd A LXttlX LXmb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ReplaceChars "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres2;
@@ -501,27 +500,27 @@ static bool CheckStringOperations()
if (!kwsys::SystemTools::StringStartsWith("Mary Had A Little Lamb.",
"Mary "))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with StringStartsWith "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
if (!kwsys::SystemTools::StringEndsWith("Mary Had A Little Lamb.",
" Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with StringEndsWith "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
cres = kwsys::SystemTools::DuplicateString("Mary Had A Little Lamb.");
if (strcmp(cres,"Mary Had A Little Lamb."))
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with DuplicateString "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
delete [] cres;
@@ -530,20 +529,20 @@ static bool CheckStringOperations()
if (kwsys::SystemTools::CropString(test,13) !=
"Mary ...Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with CropString "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
- kwsys_stl::vector<kwsys_stl::string> lines;
+ std::vector<std::string> lines;
kwsys::SystemTools::Split("Mary Had A Little Lamb.",lines,' ');
if (lines[0] != "Mary" || lines[1] != "Had" ||
lines[2] != "A" || lines[3] != "Little" || lines[4] != "Lamb.")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with Split "
- << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl;
+ << "\"Mary Had A Little Lamb.\"" << std::endl;
res = false;
}
@@ -552,10 +551,10 @@ static bool CheckStringOperations()
("L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -563,10 +562,10 @@ static bool CheckStringOperations()
("L:/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -574,10 +573,10 @@ static bool CheckStringOperations()
("\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") !=
L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -585,70 +584,70 @@ static bool CheckStringOperations()
("//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("//") !=
L"//")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"//\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\") !=
L"\\\\.\\")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X") !=
L"\\\\.\\X")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:") !=
L"\\\\?\\X:")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X:\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:\\") !=
L"\\\\?\\X:\\")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"\\\\.\\X:\\\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
if (kwsys::SystemTools::ConvertToWindowsExtendedPath("NUL") !=
L"\\\\.\\NUL")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsExtendedPath "
<< "\"NUL\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -658,10 +657,10 @@ static bool CheckStringOperations()
("L://Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsOutputPath "
<< "\"L://Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -669,10 +668,10 @@ static bool CheckStringOperations()
("//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"\"\\\\grayson\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToWindowsOutputPath "
<< "\"//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -680,10 +679,10 @@ static bool CheckStringOperations()
("//Local Mojo/Hex Power Pack/Iffy Voodoo") !=
"//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo")
{
- kwsys_ios::cerr
+ std::cerr
<< "Problem with ConvertToUnixOutputPath "
<< "\"//Local Mojo/Hex Power Pack/Iffy Voodoo\""
- << kwsys_ios::endl;
+ << std::endl;
res = false;
}
@@ -692,20 +691,20 @@ static bool CheckStringOperations()
//----------------------------------------------------------------------------
-static bool CheckPutEnv(const kwsys_stl::string& env, const char* name, const char* value)
+static bool CheckPutEnv(const std::string& env, const char* name, const char* value)
{
if(!kwsys::SystemTools::PutEnv(env))
{
- kwsys_ios::cerr << "PutEnv(\"" << env
- << "\") failed!" << kwsys_ios::endl;
+ std::cerr << "PutEnv(\"" << env
+ << "\") failed!" << std::endl;
return false;
}
const char* v = kwsys::SystemTools::GetEnv(name);
v = v? v : "(null)";
if(strcmp(v, value) != 0)
{
- kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \""
- << v << "\", not \"" << value << "\"!" << kwsys_ios::endl;
+ std::cerr << "GetEnv(\"" << name << "\") returned \""
+ << v << "\", not \"" << value << "\"!" << std::endl;
return false;
}
return true;
@@ -715,14 +714,14 @@ static bool CheckUnPutEnv(const char* env, const char* name)
{
if(!kwsys::SystemTools::UnPutEnv(env))
{
- kwsys_ios::cerr << "UnPutEnv(\"" << env << "\") failed!"
- << kwsys_ios::endl;
+ std::cerr << "UnPutEnv(\"" << env << "\") failed!"
+ << std::endl;
return false;
}
if(const char* v = kwsys::SystemTools::GetEnv(name))
{
- kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \""
- << v << "\", not (null)!" << kwsys_ios::endl;
+ std::cerr << "GetEnv(\"" << name << "\") returned \""
+ << v << "\", not (null)!" << std::endl;
return false;
}
return true;
@@ -744,15 +743,15 @@ static bool CheckEnvironmentOperations()
static bool CheckRelativePath(
- const kwsys_stl::string& local,
- const kwsys_stl::string& remote,
- const kwsys_stl::string& expected)
+ const std::string& local,
+ const std::string& remote,
+ const std::string& expected)
{
- kwsys_stl::string result = kwsys::SystemTools::RelativePath(local, remote);
+ std::string result = kwsys::SystemTools::RelativePath(local, remote);
if(expected != result)
{
- kwsys_ios::cerr << "RelativePath(" << local << ", " << remote
- << ") yielded " << result << " instead of " << expected << kwsys_ios::endl;
+ std::cerr << "RelativePath(" << local << ", " << remote
+ << ") yielded " << result << " instead of " << expected << std::endl;
return false;
}
return true;
@@ -770,14 +769,14 @@ static bool CheckRelativePaths()
}
static bool CheckCollapsePath(
- const kwsys_stl::string& path,
- const kwsys_stl::string& expected)
+ const std::string& path,
+ const std::string& expected)
{
- kwsys_stl::string result = kwsys::SystemTools::CollapseFullPath(path);
+ std::string result = kwsys::SystemTools::CollapseFullPath(path);
if(expected != result)
{
- kwsys_ios::cerr << "CollapseFullPath(" << path
- << ") yielded " << result << " instead of " << expected << kwsys_ios::endl;
+ std::cerr << "CollapseFullPath(" << path
+ << ") yielded " << result << " instead of " << expected << std::endl;
return false;
}
return true;
@@ -803,7 +802,7 @@ int testSystemTools(int, char*[])
}
// Special check for ~
- kwsys_stl::string output;
+ std::string output;
if(kwsys::SystemTools::GetEnv("HOME", output))
{
output += "/foo bar/lala";