Skip to content

Commit bc656be

Browse files
committed
Fix lambda capture for both osx and windows
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
1 parent 8c22a1e commit bc656be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rosbag2_transport/test/rosbag2_transport/test_record.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ TEST_F(RecordIntegrationTestFixture, receives_latched_messages)
160160
// Takes ~100ms in local testing, 5s chosen as a very long timeout
161161
bool succeeded = rosbag2_test_common::spin_and_wait_for(
162162
std::chrono::seconds(5), publisher_node,
163-
[&writer]() {
163+
// The = is necessary due to an implementation difference between clang and windows
164+
// Clang claims capture is unecessary (and we use -Werror), but windows needs it
165+
[&writer, num_latched_messages=num_latched_messages]() {
164166
return writer.get_messages().size() == num_latched_messages;
165167
});
166168
stop_recording();

0 commit comments

Comments
 (0)