Skip to content

Commit

Permalink
Added test for isHandlerReady
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed May 10, 2024
1 parent 7ea9152 commit 14d0f9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion planning/route_handler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ if(BUILD_TESTING)
route_parser)

target_link_libraries(test_route_handler
route_handler)
route_handler
route_parser
)

endif()

Expand Down
11 changes: 9 additions & 2 deletions planning/route_handler/test/test_route_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@

#include "test_route_handler.hpp"

#include "route_parser.hpp"

#include <rclcpp/rclcpp.hpp>

#include <gtest/gtest.h>

namespace route_handler::test
{
TEST_F(TestRouteHandler, testSomething)
TEST_F(TestRouteHandler, isRouteHandlerReadyTest)
{
ASSERT_EQ(1, 1);
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";
ASSERT_FALSE(route_handler_->isHandlerReady());
route_handler_->setRoute(parse_route_file(rh_test_route));
ASSERT_TRUE(route_handler_->isHandlerReady());
}

int main(int argc, char * argv[])
Expand Down

0 comments on commit 14d0f9c

Please sign in to comment.