diff --git a/src/Server_TEST.cc b/src/Server_TEST.cc index 59879223b5..6a95bf93b9 100644 --- a/src/Server_TEST.cc +++ b/src/Server_TEST.cc @@ -1108,9 +1108,9 @@ TEST_P(ServerFixture, AddResourcePaths) ///////////////////////////////////////////////// TEST_P(ServerFixture, ResolveResourcePaths) { - ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH", ""); - ignition::common::setenv("SDF_PATH", ""); - ignition::common::setenv("IGN_FILE_PATH", ""); + common::setenv("IGN_GAZEBO_RESOURCE_PATH", ""); + common::setenv("SDF_PATH", ""); + common::setenv("IGN_FILE_PATH", ""); ServerConfig serverConfig; gazebo::Server server(serverConfig); @@ -1143,10 +1143,10 @@ TEST_P(ServerFixture, ResolveResourcePaths) }); // Make sure the resource path is clear - ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH", ""); + common::setenv("IGN_GAZEBO_RESOURCE_PATH", ""); - // An absolute path should return the same absolute path - test(PROJECT_SOURCE_PATH, PROJECT_SOURCE_PATH, true); + // A valid path should be returned as an absolute path + test(PROJECT_SOURCE_PATH, common::absPath(PROJECT_SOURCE_PATH), true); // An absolute path, with the file:// prefix, should return the absolute path test(std::string("file://") + @@ -1168,7 +1168,7 @@ TEST_P(ServerFixture, ResolveResourcePaths) // The model:// URI should not resolve test("model://include_nested/model.sdf", "", false); - ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH", + common::setenv("IGN_GAZEBO_RESOURCE_PATH", common::joinPaths(PROJECT_SOURCE_PATH, "test", "worlds", "models")); // The model:// URI should now resolve because the RESOURCE_PATH has been // updated. diff --git a/src/SystemLoader_TEST.cc b/src/SystemLoader_TEST.cc index 8d3882ec35..57832ff421 100644 --- a/src/SystemLoader_TEST.cc +++ b/src/SystemLoader_TEST.cc @@ -21,6 +21,7 @@ #include #include +#include #include "ignition/gazebo/System.hh" #include "ignition/gazebo/SystemLoader.hh" @@ -93,13 +94,13 @@ TEST(SystemLoader, PluginPaths) for (const auto &s : paths) { // the returned path string may not be exact match due to extra '/' - // appended at the end of the string. So use absPath to generate - // a path string that matches the format returned by joinPaths - if (common::absPath(s) == testBuildPath) + // appended at the end of the string. So use NormalizeDirectoryPath + if (common::SystemPaths::NormalizeDirectoryPath(s) == + common::SystemPaths::NormalizeDirectoryPath(testBuildPath)) { hasPath = true; break; } } - EXPECT_TRUE(hasPath); + EXPECT_TRUE(hasPath) << testBuildPath; }