Skip to content

Commit

Permalink
Added additional test
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed May 10, 2024
1 parent b5e38a9 commit 1970163
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
17 changes: 11 additions & 6 deletions planning/route_handler/test/test_route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions planning/route_handler/test/test_route_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1970163

Please sign in to comment.