-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[humble] rosbag2_cpp: test more than one storage plugin (backport #1196…
…) (#1721) * rosbag2_cpp: test more than one storage plugin (#1196) * rosbag2_storage_mcap: fix rosbag2_cpp tests Signed-off-by: James Smith <[email protected]> * rosbag2_cpp: test several storage plugins Signed-off-by: James Smith <[email protected]> * rosbag2_transport: specify test dependency on plugins Signed-off-by: James Smith <[email protected]> * ros2bag: add default plugins for testing Signed-off-by: James Smith <[email protected]> Signed-off-by: James Smith <[email protected]> (cherry picked from commit 9d7d7c3) # Conflicts: # mcap_vendor/CMakeLists.txt # rosbag2_cpp/test/rosbag2_cpp/test_info.cpp # rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp # rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp # rosbag2_storage_mcap/CMakeLists.txt # rosbag2_storage_mcap/src/mcap_storage.cpp * Rebase and address merge conflicts Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: james-rms <[email protected]> Co-authored-by: Michael Orlov <[email protected]>
- Loading branch information
1 parent
ca07426
commit 9659874
Showing
8 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
rosbag2_test_common/include/rosbag2_test_common/tested_storage_ids.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2022, Foxglove Technologies Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSBAG2_TEST_COMMON__TESTED_STORAGE_IDS_HPP_ | ||
#define ROSBAG2_TEST_COMMON__TESTED_STORAGE_IDS_HPP_ | ||
#include <array> | ||
#include <string> | ||
|
||
|
||
namespace rosbag2_test_common | ||
{ | ||
static const std::array<std::string, 2> kTestedStorageIDs = { | ||
"sqlite3", | ||
"mcap", | ||
}; | ||
|
||
std::string bag_filename_for_storage_id(const std::string & name, const std::string & storage_id) | ||
{ | ||
const std::array<std::string, 2> extensions = {".db3", ".mcap"}; | ||
static_assert(kTestedStorageIDs.size() == extensions.size()); | ||
for (size_t i = 0; i < extensions.size(); ++i) { | ||
if (kTestedStorageIDs[i] == storage_id) { | ||
return name + extensions[i]; | ||
} | ||
} | ||
throw std::runtime_error("unknown storage id: " + storage_id); | ||
} | ||
|
||
} // namespace rosbag2_test_common | ||
|
||
#endif // ROSBAG2_TEST_COMMON__TESTED_STORAGE_IDS_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters