From 92f4434a7a450c3276918e497c6fb23dce56f4fb Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Mon, 27 Dec 2021 09:57:24 -0800 Subject: [PATCH 1/4] Bumps in garden : ci_matching_branch/bump_garden_ign-fuel-tools8 Signed-off-by: Louise Poubel --- .github/ci/packages.apt | 4 ++-- CMakeLists.txt | 8 ++++---- tutorials/01_installation.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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/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: From 3fec714b5ef25d8d1cc732a32d532db039eecb2b Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Tue, 28 Dec 2021 17:57:38 -0800 Subject: [PATCH 2/4] update tests Signed-off-by: Louise Poubel --- src/ClientConfig_TEST.cc | 2 +- src/LocalCache_TEST.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/LocalCache_TEST.cc b/src/LocalCache_TEST.cc index 683f19c8..c44a0185 100644 --- a/src/LocalCache_TEST.cc +++ b/src/LocalCache_TEST.cc @@ -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; @@ -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); From 9660181496e9cf40c9f68510eda7e151f60441d5 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 29 Dec 2021 08:30:38 -0800 Subject: [PATCH 3/4] Windows tests Signed-off-by: Louise Poubel --- src/CollectionIdentifier_TEST.cc | 2 +- src/FuelClient_TEST.cc | 21 +++-- src/LocalCache_TEST.cc | 152 +++++++++++++++---------------- src/ModelIdentifier_TEST.cc | 2 +- 4 files changed, 91 insertions(+), 86 deletions(-) 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..53876d1f 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; diff --git a/src/LocalCache_TEST.cc b/src/LocalCache_TEST.cc index c44a0185..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); @@ -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); 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")); From 8fe711ddeb1a88e107b52094bd303b003910b372 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 29 Dec 2021 09:46:58 -0800 Subject: [PATCH 4/4] Fix ResultType tests Signed-off-by: Louise Poubel --- src/FuelClient_TEST.cc | 90 +++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/FuelClient_TEST.cc b/src/FuelClient_TEST.cc index 53876d1f..9ac83052 100644 --- a/src/FuelClient_TEST.cc +++ b/src/FuelClient_TEST.cc @@ -423,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", @@ -447,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); } @@ -461,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", @@ -485,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. @@ -516,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` @@ -551,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 @@ -583,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 @@ -592,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()); } } @@ -619,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); } @@ -630,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); } @@ -641,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); } @@ -653,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); } @@ -665,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); } @@ -676,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) @@ -685,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 @@ -696,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 @@ -705,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 @@ -714,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 @@ -723,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()); } } @@ -1019,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", @@ -1041,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); } @@ -1052,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 @@ -1061,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()); } } @@ -1088,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); } @@ -1099,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); } @@ -1110,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); } @@ -1122,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); @@ -1135,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); @@ -1147,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) @@ -1157,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 @@ -1167,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 @@ -1176,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 @@ -1185,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 @@ -1194,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()); } }