diff --git a/rclcpp/test/rclcpp/test_publisher_with_type_adapter.cpp b/rclcpp/test/rclcpp/test_publisher_with_type_adapter.cpp index 8b9d25aef3..01fc38dfd9 100644 --- a/rclcpp/test/rclcpp/test_publisher_with_type_adapter.cpp +++ b/rclcpp/test/rclcpp/test_publisher_with_type_adapter.cpp @@ -166,19 +166,25 @@ TEST_F(TestPublisher, various_creation_signatures) { /* * Testing that conversion errors are passed up. - * TODO. This test was removed when implementing non convering intra-proccess - * publishing. It may be fixed and added again later. */ -// TEST_F(TestPublisher, conversion_exception_is_passed_up) { -// using BadStringTypeAdapter = rclcpp::TypeAdapter; -// for (auto is_intra_process : {true, false}) { -// rclcpp::NodeOptions options; -// options.use_intra_process_comms(is_intra_process); -// initialize(options); -// auto pub = node->create_publisher("topic_name", 1); -// EXPECT_THROW(pub->publish(1), std::runtime_error); -// } -// } +TEST_F(TestPublisher, conversion_exception_is_passed_up) { + using BadStringTypeAdapter = rclcpp::TypeAdapter; + for (auto is_intra_process : {true, false}) { + rclcpp::NodeOptions options; + options.use_intra_process_comms(is_intra_process); + + auto callback = + [](const rclcpp::msg::String::ConstSharedPtr msg) -> void + { + (void)msg; + }; + + initialize(options); + auto pub = node->create_publisher("topic_name", 1); + auto sub = node->create_subscription("topic_name", 1, callback); + EXPECT_THROW(pub->publish(1), std::runtime_error); + } +} /* * Testing that publisher sends type adapted types and ROS message types with intra proccess communications.