diff --git a/.github/ci/packages.apt b/.github/ci/packages.apt index 36bf3867..f1fa13ad 100644 --- a/.github/ci/packages.apt +++ b/.github/ci/packages.apt @@ -2,8 +2,8 @@ curl libcurl4-openssl-dev libgflags-dev libignition-cmake2-dev -libignition-common4-dev -libignition-math6-dev +libignition-common5-dev +libignition-math7-dev libignition-msgs9-dev libignition-tools-dev libjsoncpp-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index b68ca14b..a02ea1d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,13 +47,13 @@ ign_find_package(ZIP REQUIRED PRIVATE) #-------------------------------------- # Find ignition-common -ign_find_package(ignition-common4 REQUIRED PRIVATE) -set(IGN_COMMON_MAJOR_VER ${ignition-common4_VERSION_MAJOR}) +ign_find_package(ignition-common5 REQUIRED PRIVATE) +set(IGN_COMMON_MAJOR_VER ${ignition-common5_VERSION_MAJOR}) #-------------------------------------- # Find ignition-math -ign_find_package(ignition-math6 REQUIRED PRIVATE) -set(IGN_MSGS_MAJOR_VER ${ignition-math6_VERSION_MAJOR}) +ign_find_package(ignition-math7 REQUIRED PRIVATE) +set(IGN_MSGS_MAJOR_VER ${ignition-math7_VERSION_MAJOR}) #-------------------------------------- # Find ignition-msgs diff --git a/src/ClientConfig_TEST.cc b/src/ClientConfig_TEST.cc index 692b87a1..dc87a339 100644 --- a/src/ClientConfig_TEST.cc +++ b/src/ClientConfig_TEST.cc @@ -413,7 +413,7 @@ TEST(ServerConfig, Url) // Trailing / { ServerConfig srv; - srv.SetUrl(common::URI("http://banana:8080/")); + srv.SetUrl(common::URI("http://banana:8080")); EXPECT_EQ("http://banana:8080", srv.Url().Str()); EXPECT_EQ("http", srv.Url().Scheme()); EXPECT_EQ("banana:8080", srv.Url().Path().Str()); diff --git a/src/CollectionIdentifier_TEST.cc b/src/CollectionIdentifier_TEST.cc index 6fe674f3..592998f4 100644 --- a/src/CollectionIdentifier_TEST.cc +++ b/src/CollectionIdentifier_TEST.cc @@ -46,7 +46,7 @@ TEST(CollectionIdentifier, SetFields) TEST(CollectionIdentifier, UniqueName) { ignition::fuel_tools::ServerConfig srv1; - srv1.SetUrl(common::URI("https://localhost:8001/")); + srv1.SetUrl(common::URI("https://localhost:8001")); ignition::fuel_tools::ServerConfig srv2; srv2.SetUrl(common::URI("https://localhost:8002")); diff --git a/src/FuelClient_TEST.cc b/src/FuelClient_TEST.cc index de72f08d..9ac83052 100644 --- a/src/FuelClient_TEST.cc +++ b/src/FuelClient_TEST.cc @@ -50,8 +50,10 @@ void createLocalModel(ClientConfig &_conf) auto modelPath = common::joinPaths( "test_cache", "localhost:8007", "alice", "models", "My Model"); - common::createDirectories(common::joinPaths(modelPath, "2", "meshes")); - common::createDirectories(common::joinPaths(modelPath, "3", "meshes")); + EXPECT_TRUE(common::createDirectories( + common::joinPaths(modelPath, "2", "meshes"))); + EXPECT_TRUE(common::createDirectories( + common::joinPaths(modelPath, "3", "meshes"))); { std::ofstream fout(common::joinPaths(modelPath, "2", "model.config"), @@ -60,8 +62,9 @@ void createLocalModel(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(modelPath, "2", "model.config"), - common::joinPaths(modelPath, "3", "model.config")); + EXPECT_TRUE(common::copyFile( + common::joinPaths(modelPath, "2", "model.config"), + common::joinPaths(modelPath, "3", "model.config"))); } { @@ -71,8 +74,9 @@ void createLocalModel(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(modelPath, "2", "model.sdf"), - common::joinPaths(modelPath, "3", "model.sdf")); + EXPECT_TRUE(common::copyFile( + common::joinPaths(modelPath, "2", "model.sdf"), + common::joinPaths(modelPath, "3", "model.sdf"))); } { @@ -82,8 +86,9 @@ void createLocalModel(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(modelPath, "2", "meshes", "model.dae"), - common::joinPaths(modelPath, "3", "meshes", "model.dae")); + EXPECT_TRUE(common::copyFile( + common::joinPaths(modelPath, "2", "meshes", "model.dae"), + common::joinPaths(modelPath, "3", "meshes", "model.dae"))); } ignition::fuel_tools::ServerConfig srv; @@ -418,13 +423,13 @@ TEST_F(FuelClientTest, DownloadModel) std::string cachedPath; Result res1 = client.CachedModel(url, cachedPath); EXPECT_FALSE(res1); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res1); + EXPECT_EQ(ResultType::FETCH_ERROR, res1.Type()); // Download std::string path; Result res2 = client.DownloadModel(url, path); EXPECT_TRUE(res2); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res2); + EXPECT_EQ(ResultType::FETCH, res2.Type()); // Check it was downloaded to `2` auto modelPath = common::joinPaths(common::cwd(), "test_cache", @@ -442,7 +447,7 @@ TEST_F(FuelClientTest, DownloadModel) // Check it is cached Result res3 = client.CachedModel(url, cachedPath); EXPECT_TRUE(res3); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res3); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res3.Type()); EXPECT_EQ(common::joinPaths(modelPath, "2"), cachedPath); } @@ -456,13 +461,13 @@ TEST_F(FuelClientTest, DownloadModel) std::string cachedPath; Result res1 = client.CachedModel(url, cachedPath); EXPECT_FALSE(res1); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res1); + EXPECT_EQ(ResultType::FETCH_ERROR, res1.Type()); // Download std::string path; Result res2 = client.DownloadModel(url, path); EXPECT_TRUE(res2); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res2); + EXPECT_EQ(ResultType::FETCH, res2.Type()); // Check it was downloaded to `2` auto modelPath = common::joinPaths(common::cwd(), "test_cache", @@ -480,7 +485,7 @@ TEST_F(FuelClientTest, DownloadModel) // Check it is cached Result res3 = client.CachedModel(url, cachedPath); EXPECT_TRUE(res3); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res3); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res3.Type()); EXPECT_EQ(common::joinPaths(modelPath, "2"), cachedPath); // Check that URIs have been updated. @@ -511,28 +516,28 @@ TEST_F(FuelClientTest, DownloadModel) std::string cachedPath; Result res1 = client.CachedModel(url, cachedPath); EXPECT_FALSE(res1); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res1); + EXPECT_EQ(ResultType::FETCH_ERROR, res1.Type()); // Check the dependency is not cached Result res2 = client.CachedModel(depUrl, cachedPath); EXPECT_FALSE(res2); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res2); + EXPECT_EQ(ResultType::FETCH_ERROR, res2.Type()); // Download std::string path; Result res3 = client.DownloadModel(url, path); EXPECT_TRUE(res3); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res3); + EXPECT_EQ(ResultType::FETCH, res3.Type()); // Check it is cached Result res4 = client.CachedModel(url, cachedPath); EXPECT_TRUE(res4); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res4); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res4.Type()); // Check the dependency is cached Result res5 = client.CachedModel(depUrl, cachedPath); EXPECT_TRUE(res5); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res5); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res5.Type()); } // Download model with a dependency specified within its `model.config` @@ -546,28 +551,28 @@ TEST_F(FuelClientTest, DownloadModel) std::string cachedPath; Result res1 = client.CachedModel(url, cachedPath); EXPECT_FALSE(res1); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res1); + EXPECT_EQ(ResultType::FETCH_ERROR, res1.Type()); // Check the dependency is not cached Result res2 = client.CachedModel(depUrl, cachedPath); EXPECT_FALSE(res2); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res2); + EXPECT_EQ(ResultType::FETCH_ERROR, res2.Type()); // Download std::string path; Result res3 = client.DownloadModel(url, path); EXPECT_TRUE(res3); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res3); + EXPECT_EQ(ResultType::FETCH, res3.Type()); // Check it is cached Result res4 = client.CachedModel(url, cachedPath); EXPECT_TRUE(res4); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res4); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res4.Type()); // Check the dependency is cached Result res5 = client.CachedModel(depUrl, cachedPath); EXPECT_TRUE(res5); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res5); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res5.Type()); } // Try using nonexistent URL @@ -578,7 +583,7 @@ TEST_F(FuelClientTest, DownloadModel) std::string path; Result result = client.DownloadModel(common::URI(url), path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Try using bad URL @@ -587,7 +592,7 @@ TEST_F(FuelClientTest, DownloadModel) std::string path; Result result = client.DownloadModel(common::URI(url), path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } } @@ -614,7 +619,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModel(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "alice", "models", "My Model", "3"), path); } @@ -625,7 +630,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModel(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "alice", "models", "My Model", "3"), path); } @@ -636,7 +641,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModel(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "alice", "models", "My Model", "2"), path); } @@ -648,7 +653,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "alice", "models", "My Model", "3", "model.sdf"), path); } @@ -660,7 +665,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "alice", "models", "My Model", "2", "meshes", "model.dae"), path); } @@ -671,7 +676,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModel(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Non-cached model (when looking for file) @@ -680,7 +685,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Non-cached model file @@ -691,7 +696,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Model root URL to model file @@ -700,7 +705,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Bad model URL @@ -709,7 +714,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModel(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Bad model file URL @@ -718,7 +723,7 @@ TEST_F(FuelClientTest, CachedModel) std::string path; auto result = client.CachedModelFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } } @@ -1014,13 +1019,13 @@ TEST_F(FuelClientTest, DownloadWorld) std::string cachedPath; auto res1 = client.CachedWorld(url, cachedPath); EXPECT_FALSE(res1); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), res1); + EXPECT_EQ(ResultType::FETCH_ERROR, res1.Type()); // Download std::string path; auto res2 = client.DownloadWorld(url, path); EXPECT_TRUE(res2); - EXPECT_EQ(Result(ResultType::FETCH), res2); + EXPECT_EQ(ResultType::FETCH, res2.Type()); // Check it was downloaded to `1` auto worldPath = common::joinPaths(common::cwd(), "test_cache", @@ -1036,7 +1041,7 @@ TEST_F(FuelClientTest, DownloadWorld) // Check it is cached auto res3 = client.CachedWorld(url, cachedPath); EXPECT_TRUE(res3); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), res3); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, res3.Type()); EXPECT_EQ(common::joinPaths(worldPath, "2"), cachedPath); } @@ -1047,7 +1052,7 @@ TEST_F(FuelClientTest, DownloadWorld) std::string path; auto result = client.DownloadWorld(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Try using bad URL @@ -1056,7 +1061,7 @@ TEST_F(FuelClientTest, DownloadWorld) std::string path; auto result = client.DownloadWorld(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } } @@ -1083,7 +1088,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorld(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "banana", "worlds", "My World", "3"), path); } @@ -1094,7 +1099,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorld(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "banana", "worlds", "My World", "3"), path); } @@ -1105,7 +1110,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorld(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "banana", "worlds", "My World", "2"), path); } @@ -1117,7 +1122,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "banana", "worlds", "My World", "3", "strawberry.world"), path); @@ -1130,7 +1135,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_TRUE(result); - EXPECT_EQ(Result(ResultType::FETCH_ALREADY_EXISTS), result); + EXPECT_EQ(ResultType::FETCH_ALREADY_EXISTS, result.Type()); EXPECT_EQ(common::joinPaths(common::cwd(), "test_cache", "localhost:8007", "banana", "worlds", "My World", "2", "strawberry.world"), path); @@ -1142,7 +1147,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorld(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Non-cached world (when looking for file) @@ -1152,7 +1157,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Non-cached world file @@ -1162,7 +1167,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // World root URL to world file @@ -1171,7 +1176,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Bad world URL @@ -1180,7 +1185,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorld(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } // Bad world file URL @@ -1189,7 +1194,7 @@ TEST_F(FuelClientTest, CachedWorld) std::string path; auto result = client.CachedWorldFile(url, path); EXPECT_FALSE(result); - EXPECT_EQ(Result(ResultType::FETCH_ERROR), result); + EXPECT_EQ(ResultType::FETCH_ERROR, result.Type()); } } diff --git a/src/LocalCache_TEST.cc b/src/LocalCache_TEST.cc index 683f19c8..4aaeb240 100644 --- a/src/LocalCache_TEST.cc +++ b/src/LocalCache_TEST.cc @@ -47,18 +47,18 @@ void createLocal6Models(ClientConfig &_conf) igndbg << "Creating 6 local models in [" << common::cwd() << "]" << std::endl; auto serverPath = common::joinPaths("test_cache", "localhost:8001"); - common::createDirectories(common::joinPaths(serverPath, - "alice", "models", "am1", "2")); - common::createDirectories(common::joinPaths(serverPath, - "alice", "models", "am2", "1")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "models", "bm1", "1")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "models", "bm2", "2")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "models", "tm1", "3")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "models", "tm2", "2")); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "models", "am1", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "models", "am2", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "models", "bm1", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "models", "bm2", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "models", "tm1", "3"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "models", "tm2", "2"))); std::ofstream fout(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), @@ -67,26 +67,26 @@ void createLocal6Models(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(serverPath, + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "alice", "models", "am2", "1", "model.config")); - common::copyFile(common::joinPaths(serverPath, + "alice", "models", "am2", "1", "model.config"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "bob", "models", "bm1", "1", "model.config")); - common::copyFile(common::joinPaths(serverPath, + "bob", "models", "bm1", "1", "model.config"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "bob", "models", "bm2", "2", "model.config")); - common::copyFile(common::joinPaths(serverPath, + "bob", "models", "bm2", "2", "model.config"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "trudy", "models", "tm1", "3", "model.config")); - common::copyFile(common::joinPaths(serverPath, + "trudy", "models", "tm1", "3", "model.config"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "trudy", "models", "tm2", "2", "model.config")); + "trudy", "models", "tm2", "2", "model.config"))); ignition::fuel_tools::ServerConfig srv; srv.SetUrl(common::URI("http://localhost:8001/")); @@ -99,12 +99,12 @@ void createLocal3Models(ClientConfig &_conf) igndbg << "Creating 3 local models in [" << common::cwd() << "]" << std::endl; auto serverPath = common::joinPaths("test_cache", "localhost:8007"); - common::createDirectories(common::joinPaths(serverPath, - "alice", "models", "am1", "2")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "models", "bm1", "1")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "models", "tm1", "3")); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "models", "am1", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "models", "bm1", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "models", "tm1", "3"))); std::ofstream fout(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), @@ -113,14 +113,14 @@ void createLocal3Models(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(serverPath, + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "bob", "models", "bm1", "1", "model.config")); - common::copyFile(common::joinPaths(serverPath, + "bob", "models", "bm1", "1", "model.config"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "models", "am1", "2", "model.config"), common::joinPaths(serverPath, - "trudy", "models", "tm1", "3", "model.config")); + "trudy", "models", "tm1", "3", "model.config"))); ignition::fuel_tools::ServerConfig srv; srv.SetUrl(ignition::common::URI("http://localhost:8007/")); @@ -133,18 +133,18 @@ void createLocal6Worlds(ClientConfig &_conf) igndbg << "Creating 6 local worlds in [" << common::cwd() << "]" << std::endl; auto serverPath = common::joinPaths("test_cache", "localhost:8001"); - common::createDirectories(common::joinPaths(serverPath, - "alice", "worlds", "am1", "2")); - common::createDirectories(common::joinPaths(serverPath, - "alice", "worlds", "am2", "1")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "worlds", "bm1", "1")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "worlds", "bm2", "2")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "worlds", "tm1", "3")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "worlds", "tm2", "2")); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "worlds", "am1", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "worlds", "am2", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "worlds", "bm1", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "worlds", "bm2", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "worlds", "tm1", "3"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "worlds", "tm2", "2"))); std::ofstream fout(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), @@ -153,26 +153,26 @@ void createLocal6Worlds(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(serverPath, + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "alice", "worlds", "am2", "1", "world.world")); - common::copyFile(common::joinPaths(serverPath, + "alice", "worlds", "am2", "1", "world.world"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "bob", "worlds", "bm1", "1", "world.world")); - common::copyFile(common::joinPaths(serverPath, + "bob", "worlds", "bm1", "1", "world.world"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "bob", "worlds", "bm2", "2", "world.world")); - common::copyFile(common::joinPaths(serverPath, + "bob", "worlds", "bm2", "2", "world.world"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "trudy", "worlds", "tm1", "3", "world.world")); - common::copyFile(common::joinPaths(serverPath, + "trudy", "worlds", "tm1", "3", "world.world"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "trudy", "worlds", "tm2", "2", "world.world")); + "trudy", "worlds", "tm2", "2", "world.world"))); ignition::fuel_tools::ServerConfig srv; srv.SetUrl(ignition::common::URI("http://localhost:8001/")); @@ -185,12 +185,12 @@ void createLocal3Worlds(ClientConfig &_conf) igndbg << "Creating 3 local worlds in [" << common::cwd() << "]" << std::endl; auto serverPath = common::joinPaths("test_cache", "localhost:8007"); - common::createDirectories(common::joinPaths(serverPath, - "alice", "worlds", "am1", "2")); - common::createDirectories(common::joinPaths(serverPath, - "bob", "worlds", "bm1", "1")); - common::createDirectories(common::joinPaths(serverPath, - "trudy", "worlds", "tm1", "3")); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "alice", "worlds", "am1", "2"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "bob", "worlds", "bm1", "1"))); + EXPECT_TRUE(common::createDirectories(common::joinPaths(serverPath, + "trudy", "worlds", "tm1", "3"))); std::ofstream fout(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), @@ -199,14 +199,14 @@ void createLocal3Worlds(ClientConfig &_conf) fout.flush(); fout.close(); - common::copyFile(common::joinPaths(serverPath, + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "bob", "worlds", "bm1", "1", "world.world")); - common::copyFile(common::joinPaths(serverPath, + "bob", "worlds", "bm1", "1", "world.world"))); + EXPECT_TRUE(common::copyFile(common::joinPaths(serverPath, "alice", "worlds", "am1", "2", "world.world"), common::joinPaths(serverPath, - "trudy", "worlds", "tm1", "3", "world.world")); + "trudy", "worlds", "tm1", "3", "world.world"))); ignition::fuel_tools::ServerConfig srv; srv.SetUrl(common::URI("http://localhost:8007/")); @@ -229,8 +229,8 @@ class LocalCacheTest : public ::testing::Test TEST_F(LocalCacheTest, AllModels) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); createLocal6Models(conf); @@ -266,8 +266,8 @@ TEST_F(LocalCacheTest, AllModels) TEST_F(LocalCacheTest, MatchingModels) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.Clear(); conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); @@ -321,8 +321,8 @@ TEST_F(LocalCacheTest, MatchingModels) TEST_F(LocalCacheTest, MatchingModel) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); createLocal6Models(conf); @@ -351,7 +351,7 @@ TEST_F(LocalCacheTest, MatchingModel) ASSERT_TRUE(am1Model); EXPECT_EQ("alice", am1Model.Identification().Owner()); EXPECT_EQ("am1", am1Model.Identification().Name()); - EXPECT_EQ("http://localhost:8001", + EXPECT_EQ("http://localhost:8001/", am1Model.Identification().Server().Url().Str()); ModelIdentifier tm2; @@ -387,8 +387,8 @@ TEST_F(LocalCacheTest, MatchingModel) TEST_F(LocalCacheTest, AllWorlds) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); createLocal6Worlds(conf); @@ -429,8 +429,8 @@ TEST_F(LocalCacheTest, AllWorlds) TEST_F(LocalCacheTest, MatchingWorlds) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.Clear(); conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); @@ -473,8 +473,8 @@ TEST_F(LocalCacheTest, MatchingWorlds) TEST_F(LocalCacheTest, MatchingWorld) { ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); - common::removeAll("test_cache"); - common::createDirectories("test_cache"); + EXPECT_TRUE(common::removeAll("test_cache")); + EXPECT_TRUE(common::createDirectories("test_cache")); ClientConfig conf; conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache")); createLocal6Worlds(conf); @@ -502,7 +502,7 @@ TEST_F(LocalCacheTest, MatchingWorld) EXPECT_TRUE(cache.MatchingWorld(am1)); EXPECT_EQ("alice", am1.Owner()); EXPECT_EQ("am1", am1.Name()); - EXPECT_EQ("http://localhost:8001", am1.Server().Url().Str()); + EXPECT_EQ("http://localhost:8001/", am1.Server().Url().Str()); WorldIdentifier tm2; tm2.SetServer(srv1); diff --git a/src/ModelIdentifier_TEST.cc b/src/ModelIdentifier_TEST.cc index b1dd87ef..3a70cac4 100644 --- a/src/ModelIdentifier_TEST.cc +++ b/src/ModelIdentifier_TEST.cc @@ -58,7 +58,7 @@ TEST(ModelIdentifier, SetFields) TEST(ModelIdentifier, UniqueName) { ignition::fuel_tools::ServerConfig srv1; - srv1.SetUrl(common::URI("https://localhost:8001/")); + srv1.SetUrl(common::URI("https://localhost:8001")); ignition::fuel_tools::ServerConfig srv2; srv2.SetUrl(common::URI("https://localhost:8002")); diff --git a/tutorials/01_installation.md b/tutorials/01_installation.md index 6c2a7f45..8782f1fc 100644 --- a/tutorials/01_installation.md +++ b/tutorials/01_installation.md @@ -90,7 +90,7 @@ sudo apt-get remove libignition-fuel-tools<#>-dev Install prerequisites. A clean Ubuntu system will need: ``` -sudo apt-get install git cmake pkg-config python ruby-ronn libignition-cmake2-dev libignition-common4-dev libignition-math6-dev libignition-msgs9-dev libignition-tools-dev libzip-dev libjsoncpp-dev libcurl4-openssl-dev libyaml-dev +sudo apt-get install git cmake pkg-config python ruby-ronn libignition-cmake2-dev libignition-common5-dev libignition-math7-dev libignition-msgs9-dev libignition-tools-dev libzip-dev libjsoncpp-dev libcurl4-openssl-dev libyaml-dev ``` Clone the repository into a directory and go into it: