Skip to content

Commit a904ef7

Browse files
Added test for isHandlerReady
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
1 parent 3c2ec5a commit a904ef7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

planning/route_handler/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ if(BUILD_TESTING)
2626
route_parser)
2727

2828
target_link_libraries(test_route_handler
29-
route_handler)
29+
route_handler
30+
route_parser
31+
)
3032

3133
endif()
3234

planning/route_handler/test/test_route_handler.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@
1414

1515
#include "test_route_handler.hpp"
1616

17+
#include "route_parser.hpp"
18+
1719
#include <rclcpp/rclcpp.hpp>
1820

1921
#include <gtest/gtest.h>
2022

2123
namespace route_handler::test
2224
{
23-
TEST_F(TestRouteHandler, testSomething)
25+
TEST_F(TestRouteHandler, isRouteHandlerReadyTest)
2426
{
25-
ASSERT_EQ(1, 1);
27+
const auto planning_test_utils_dir =
28+
ament_index_cpp::get_package_share_directory("route_handler");
29+
const auto rh_test_route = planning_test_utils_dir + "/test_route/rh_test.route";
30+
ASSERT_FALSE(route_handler_->isHandlerReady());
31+
route_handler_->setRoute(parse_route_file(rh_test_route));
32+
ASSERT_TRUE(route_handler_->isHandlerReady());
2633
}
2734

2835
int main(int argc, char * argv[])

0 commit comments

Comments
 (0)