| 830 | } |
| 831 | |
| 832 | static bool CheckGetPath() |
| 833 | { |
| 834 | char const* envName = "S"; |
| 835 | #ifdef _WIN32 |
| 836 | char const* envValue = "C:\\Somewhere\\something;D:\\Temp"; |
| 837 | #else |
| 838 | char const* envValue = "/Somewhere/something:/tmp"; |
| 839 | #endif |
| 840 | char const* registryPath = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MyApp; MyKey]"; |
| 841 | |
| 842 | std::vector<std::string> originalPaths; |
| 843 | originalPaths.emplace_back(registryPath); |
| 844 | |
| 845 | std::vector<std::string> expectedPaths; |
| 846 | expectedPaths.emplace_back(registryPath); |
| 847 | #ifdef _WIN32 |
| 848 | expectedPaths.push_back("C:/Somewhere/something"); |
| 849 | expectedPaths.push_back("D:/Temp"); |
| 850 | #else |
| 851 | expectedPaths.emplace_back("/Somewhere/something"); |
| 852 | expectedPaths.emplace_back("/tmp"); |
| 853 | #endif |
| 854 | |
| 855 | bool res = true; |
| 856 | res &= CheckPutEnv(std::string(envName) + "=" + envValue, envName, envValue); |
| 857 | |
| 858 | std::vector<std::string> paths = originalPaths; |
| 859 | kwsys::SystemTools::GetPath(paths, envName); |
| 860 | |
| 861 | if (paths != expectedPaths) { |
| 862 | std::cerr << "GetPath(" << StringVectorToString(originalPaths) << ", " |
| 863 | << envName << ") yielded " << StringVectorToString(paths) |
| 864 | << " instead of " << StringVectorToString(expectedPaths) |
| 865 | << std::endl; |
| 866 | res = false; |
| 867 | } |
| 868 | |
| 869 | res &= CheckUnPutEnv(envName, envName); |
| 870 | return res; |
| 871 | } |
| 872 | |
| 873 | static bool CheckGetFilenameName() |
| 874 | { |
no test coverage detected
searching dependent graphs…