diff --git a/rosbag2_tests/test/rosbag2_tests/test_rosbag2_cpp_api.cpp b/rosbag2_tests/test/rosbag2_tests/test_rosbag2_cpp_api.cpp index 982d46093..04b356215 100644 --- a/rosbag2_tests/test/rosbag2_tests/test_rosbag2_cpp_api.cpp +++ b/rosbag2_tests/test/rosbag2_tests/test_rosbag2_cpp_api.cpp @@ -106,9 +106,7 @@ TEST_P(TestRosbag2CPPAPI, minimal_writer_example) writer.open(rosbag_directory_next.string()); // write same topic to different bag - writer.write( - serialized_msg2, "/yet/another/topic", "test_msgs/msg/BasicTypes", - rclcpp::Clock().now()); + writer.write(bag_message, "/my/other/topic", "test_msgs/msg/BasicTypes"); // close by scope } @@ -152,7 +150,7 @@ TEST_P(TestRosbag2CPPAPI, minimal_writer_example) &extracted_serialized_msg, &extracted_test_msg); EXPECT_EQ(test_msg, extracted_test_msg); - EXPECT_EQ("/yet/another/topic", topic); + EXPECT_EQ("/my/other/topic", topic); } // alternative reader