From 2d3eed95995c9e203df98c8a44493081367b82ea Mon Sep 17 00:00:00 2001 From: wep21 Date: Mon, 29 Jul 2024 19:42:51 +0900 Subject: [PATCH] chore: replace deprecated rcpputils filesystem with std::filesystem Signed-off-by: wep21 --- grid_map_ros/test/GridMapRosTest.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/grid_map_ros/test/GridMapRosTest.cpp b/grid_map_ros/test/GridMapRosTest.cpp index e48fc350..dcf2330a 100644 --- a/grid_map_ros/test/GridMapRosTest.cpp +++ b/grid_map_ros/test/GridMapRosTest.cpp @@ -18,9 +18,9 @@ #include #include #include -#include // STD +#include #include #include #include @@ -77,9 +77,9 @@ TEST(RosbagHandling, saveLoad) EXPECT_FALSE(gridMapOut.exists(layer)); // Cleaning in case the previous bag was not removed - rcpputils::fs::path dir(pathToBag); - EXPECT_TRUE(!dir.exists() || rcpputils::fs::remove_all(dir)); - EXPECT_TRUE(!dir.exists() || rcpputils::fs::create_directories(dir)); + std::filesystem::path dir(pathToBag); + EXPECT_TRUE(!std::filesystem::exists(dir) || std::filesystem::remove_all(dir)); + EXPECT_TRUE(!std::filesystem::exists(dir) || std::filesystem::create_directories(dir)); EXPECT_TRUE(GridMapRosConverter::saveToBag(gridMapIn, pathToBag, topic)); EXPECT_TRUE(GridMapRosConverter::loadFromBag(pathToBag, topic, gridMapOut)); @@ -90,7 +90,7 @@ TEST(RosbagHandling, saveLoad) } // Removing the created bag - rcpputils::fs::remove_all(dir); + std::filesystem::remove_all(dir); } TEST(RosbagHandling, saveLoadWithTime) @@ -115,9 +115,9 @@ TEST(RosbagHandling, saveLoadWithTime) gridMapIn.setTimestamp(clock.now().nanoseconds()); // Cleaning in case the previous bag was not removed - rcpputils::fs::path dir(pathToBag); - EXPECT_TRUE(!dir.exists() || rcpputils::fs::remove_all(dir)); - EXPECT_TRUE(!dir.exists() || rcpputils::fs::create_directories(dir)); + std::filesystem::path dir(pathToBag); + EXPECT_TRUE(!std::filesystem::exists(dir) || std::filesystem::remove_all(dir)); + EXPECT_TRUE(!std::filesystem::exists(dir) || std::filesystem::create_directories(dir)); EXPECT_TRUE(GridMapRosConverter::saveToBag(gridMapIn, pathToBag, topic)); EXPECT_TRUE(GridMapRosConverter::loadFromBag(pathToBag, topic, gridMapOut)); @@ -129,7 +129,7 @@ TEST(RosbagHandling, saveLoadWithTime) } // Removing the created bag - rcpputils::fs::remove_all(dir); + std::filesystem::remove_all(dir); } TEST(RosbagHandling, wrongTopicType) @@ -140,7 +140,7 @@ TEST(RosbagHandling, wrongTopicType) std::string pathToBag = "double_chatter"; string topic = "/chatter1"; GridMap gridMapOut; - rcpputils::fs::path dir(pathToBag); + std::filesystem::path dir(pathToBag); EXPECT_FALSE(GridMapRosConverter::loadFromBag(pathToBag, topic, gridMapOut)); } @@ -155,7 +155,7 @@ TEST(RosbagHandling, checkTopicTypes) string topic_correct = "/grid_map"; string topic_non_existing = "/grid_map_non_existing"; GridMap gridMapOut; - rcpputils::fs::path dir(pathToBag); + std::filesystem::path dir(pathToBag); EXPECT_FALSE(GridMapRosConverter::loadFromBag(pathToBag, topic_wrong, gridMapOut)); EXPECT_TRUE(GridMapRosConverter::loadFromBag(pathToBag, topic_correct, gridMapOut));