diff --git a/planning/route_handler/test/test_route_handler.cpp b/planning/route_handler/test/test_route_handler.cpp index 16a80debbfb80..e698c6def91a3 100644 --- a/planning/route_handler/test/test_route_handler.cpp +++ b/planning/route_handler/test/test_route_handler.cpp @@ -32,12 +32,17 @@ TEST_F(TestRouteHandler, isRouteHandlerReadyTest) ASSERT_TRUE(route_handler_->isHandlerReady()); } -int main(int argc, char * argv[]) +TEST_F(TestRouteHandler, checkIfIDReturned) { - testing::InitGoogleTest(&argc, argv); - rclcpp::init(argc, argv); - bool result = RUN_ALL_TESTS(); - rclcpp::shutdown(); - return result; + const auto planning_test_utils_dir = + ament_index_cpp::get_package_share_directory("route_handler"); + const auto rh_test_route = planning_test_utils_dir + "/test_route/rh_test.route"; + + route_handler_->setRoute(parse_route_file(rh_test_route)); + const auto lanelet = route_handler_->getLaneletsFromId(4870); + + const auto is_in_goal_route_section = route_handler_->isInGoalRouteSection(lanelet); + + ASSERT_TRUE(is_in_goal_route_section); } } // namespace route_handler::test diff --git a/planning/route_handler/test/test_route_parser.cpp b/planning/route_handler/test/test_route_parser.cpp index 86ebe3a6a131d..9e56f562e8d41 100644 --- a/planning/route_handler/test/test_route_parser.cpp +++ b/planning/route_handler/test/test_route_parser.cpp @@ -130,9 +130,4 @@ TEST(ParseFunction, CompleteFromFilename) EXPECT_EQ(segment1.primitives[3].id, 88); EXPECT_EQ(segment1.primitives[3].primitive_type, "lane"); } -int main(int argc, char ** argv) -{ - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} } // namespace route_handler::test