diff --git a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp index 5db28211e8..e2c04af9f2 100644 --- a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp +++ b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp @@ -71,7 +71,7 @@ class SequentialReaderTest : public Test EXPECT_CALL(*storage_factory, open_read_only(_, _)); ON_CALL(*storage_factory, open_read_only).WillByDefault( - [this](const std::string & path, const std::string & /* storage_id */) { + [this, relative_file_path](const std::string & path, const std::string & /* storage_id */) { EXPECT_STREQ(relative_file_path.c_str(), path.c_str()); return storage_; });