From 5c8f8216dce58c0e1a1a6e9dda5defdb6a6c209e Mon Sep 17 00:00:00 2001 From: Anish Date: Fri, 22 Mar 2024 17:03:58 -0400 Subject: [PATCH] fix file loading for unit test --- .../test/test_emergency_response_vehicle_plugin.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/carma-messenger-core/emergency_response_vehicle_plugin/test/test_emergency_response_vehicle_plugin.cpp b/carma-messenger-core/emergency_response_vehicle_plugin/test/test_emergency_response_vehicle_plugin.cpp index ae805908..e1f638b7 100644 --- a/carma-messenger-core/emergency_response_vehicle_plugin/test/test_emergency_response_vehicle_plugin.cpp +++ b/carma-messenger-core/emergency_response_vehicle_plugin/test/test_emergency_response_vehicle_plugin.cpp @@ -16,6 +16,7 @@ #include +#include #include "emergency_response_vehicle_plugin/emergency_response_vehicle_plugin_node.hpp" @@ -207,9 +208,7 @@ namespace emergency_response_vehicle_plugin{ worker_node->handle_on_shutdown(); } - // This unit tests has been temporarily disabled to support Continuous Improvement (CI) processes. - // Related GitHub Issue: - /** + TEST(EmergencyResponseVehiclePluginTest, testLoadRouteDestinationPointsFromFile){ rclcpp::NodeOptions options; auto worker_node = std::make_shared(options); @@ -219,7 +218,10 @@ namespace emergency_response_vehicle_plugin{ worker_node->activate(); //Call activate state transition to get not read for runtime // Provide file path to getRouteDestinationPointsFromFile() to extract route destination points - worker_node->loadRouteDestinationPointsFromFile("../../install_ros2/emergency_response_vehicle_plugin/share/emergency_response_vehicle_plugin/resource/example_route.csv"); + std::string path = ament_index_cpp::get_package_share_directory("emergency_response_vehicle_plugin"); + std::string file = "/resource/example_route.csv"; + file = path.append(file); + worker_node->loadRouteDestinationPointsFromFile(file); // Verify size and contents of route_destination_points ASSERT_EQ(worker_node->route_destination_points_.size(), 3); @@ -244,7 +246,7 @@ namespace emergency_response_vehicle_plugin{ worker_node->handle_on_shutdown(); } - */ + TEST(EmergencyResponseVehiclePluginTest, testProcessIncomingUdpBinary){ rclcpp::NodeOptions options; auto worker_node = std::make_shared(options);