Skip to content

Commit e750353

Browse files
committed
adopt rosbag2_tests
Signed-off-by: Karsten Knese <[email protected]>
1 parent 6e7e291 commit e750353

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: rosbag2_tests/test/rosbag2_tests/test_rosbag2_record_end_to_end.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_bagsize_split_is_at_least
253253
#ifdef _WIN32
254254
{
255255
rosbag2_storage::BagMetadata metadata;
256-
metadata.version = 2;
256+
metadata.version = 4;
257257
metadata.storage_identifier = "sqlite3";
258258

259259
// Loop until expected_splits in case it split or the bagfile doesn't exist.
@@ -282,7 +282,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_bagsize_split_is_at_least
282282

283283
// Don't include the last bagfile since it won't be full
284284
for (int i = 0; i < actual_splits - 1; ++i) {
285-
const auto bagfile_path = rcpputils::fs::path{metadata.relative_file_paths[i]};
285+
const auto bagfile_path = root_bag_path_ / rcpputils::fs::path{metadata.relative_file_paths[i]};
286286
ASSERT_TRUE(bagfile_path.exists()) <<
287287
"Expected bag file: \"" << bagfile_path.string() << "\" to exist.";
288288

@@ -327,7 +327,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_max_size_not_reached) {
327327
#ifdef _WIN32
328328
{
329329
rosbag2_storage::BagMetadata metadata;
330-
metadata.version = 2;
330+
metadata.version = 4;
331331
metadata.storage_identifier = "sqlite3";
332332
metadata.relative_file_paths = {get_bag_file_path(0).string()};
333333
metadata_io.write_metadata(root_bag_path_.string(), metadata);
@@ -339,7 +339,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_max_size_not_reached) {
339339

340340
// Check that there's only 1 bagfile and that it exists.
341341
EXPECT_EQ(1u, metadata.relative_file_paths.size());
342-
EXPECT_TRUE(rcpputils::fs::exists(metadata.relative_file_paths[0]));
342+
EXPECT_TRUE((root_bag_path_ / metadata.relative_file_paths[0]).exists());
343343

344344
// Check that the next bagfile does not exist.
345345
const auto next_bag_file = get_bag_file_path(1);
@@ -384,7 +384,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_splits_bagfile) {
384384
#ifdef _WIN32
385385
{
386386
rosbag2_storage::BagMetadata metadata;
387-
metadata.version = 2;
387+
metadata.version = 4;
388388
metadata.storage_identifier = "sqlite3";
389389

390390
for (int i = 0; i < expected_splits; ++i) {
@@ -406,7 +406,8 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_splits_bagfile) {
406406
wait_for_metadata();
407407
const auto metadata = metadata_io.read_metadata(root_bag_path_.string());
408408

409-
for (const auto & path : metadata.relative_file_paths) {
409+
for (const auto & rel_path : metadata.relative_file_paths) {
410+
auto path = root_bag_path_ / rcpputils::fs::path(rel_path);
410411
EXPECT_TRUE(rcpputils::fs::exists(path));
411412
}
412413
}

0 commit comments

Comments
 (0)