diff options
author | Brad King <brad.king@kitware.com> | 2017-04-19 12:02:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-19 12:02:06 (GMT) |
commit | 697a5d64d86d73b1353a90a5bfc9f444b97fedd7 (patch) | |
tree | 9780e3e1266b0d5231d1904f45808214ae9be5ba /Source/kwsys/testEncoding.cxx | |
parent | 3d3144bb023a98392594038973576cfbf046c039 (diff) | |
parent | 5785482ce0be9187ff94c1042f8978d2f11285e8 (diff) | |
download | CMake-697a5d64d86d73b1353a90a5bfc9f444b97fedd7.zip CMake-697a5d64d86d73b1353a90a5bfc9f444b97fedd7.tar.gz CMake-697a5d64d86d73b1353a90a5bfc9f444b97fedd7.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2017-04-19 (9f6ffaff)
Diffstat (limited to 'Source/kwsys/testEncoding.cxx')
-rw-r--r-- | Source/kwsys/testEncoding.cxx | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx index 03f2ec9..457e8a8 100644 --- a/Source/kwsys/testEncoding.cxx +++ b/Source/kwsys/testEncoding.cxx @@ -180,6 +180,88 @@ static int testCommandLineArguments() return status; } +static int testToWindowsExtendedPath() +{ +#ifdef _WIN32 + int ret = 0; + if (kwsys::Encoding::ToWindowsExtendedPath( + "L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != + L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "L:/Local Mojo/Hex Power Pack/Iffy Voodoo") != + L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != + L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath( + "//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") != + L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\"" + << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("//") != L"//") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"//\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\") != L"\\\\.\\") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X") != L"\\\\.\\X") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:") != L"\\\\?\\X:") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X:\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("\\\\.\\X:\\") != + L"\\\\?\\X:\\") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"\\\\.\\X:\\\"" << std::endl; + ++ret; + } + + if (kwsys::Encoding::ToWindowsExtendedPath("NUL") != L"\\\\.\\NUL") { + std::cout << "Problem with ToWindowsExtendedPath " + << "\"NUL\"" << std::endl; + ++ret; + } + + return ret; +#else + return 0; +#endif +} + //---------------------------------------------------------------------------- int testEncoding(int, char* []) { @@ -196,6 +278,7 @@ int testEncoding(int, char* []) ret |= testRobustEncoding(); ret |= testCommandLineArguments(); ret |= testWithNulls(); + ret |= testToWindowsExtendedPath(); return ret; } |