Skip to content

Commit

Permalink
Clean comments, switch to exceptions
Browse files Browse the repository at this point in the history
Distro A, OPSEC #4584

Signed-off-by: Jacob Hassold <[email protected]>
  • Loading branch information
Jacob Hassold committed Feb 12, 2021
1 parent 532c3e1 commit afb7c82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
16 changes: 2 additions & 14 deletions rosbag2_cpp/src/rosbag2_cpp/reindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,7 @@ Reindexer::Reindexer(
: storage_factory_(std::move(storage_factory)),
converter_(nullptr),
metadata_io_(std::move(metadata_io)),
converter_factory_(std::move(converter_factory))
{
// Make sure pointer isn't pointing to uninitialized memory
// std::unique_ptr<rosbag2_cpp::readers::SequentialReader> bagfile_reader = nullptr;

// // TODO: figure out how to make reader creation more generic
// // i.e: allow other reader types here, automagically
// auto bagfile_reader_ = std::make_unique<rosbag2_cpp::Reader> (
// std::make_unique<rosbag2_cpp::readers::SequentialReader>(storage_factory_,
// converter_, metadata_io_)
// );
}
converter_factory_(std::move(converter_factory)) {}

Reindexer::~Reindexer()
{
Expand Down Expand Up @@ -295,8 +284,7 @@ void Reindexer::reindex(const rosbag2_storage::StorageOptions & storage_options)
auto files = get_database_files(base_folder_);
std::cout << "Finished getting database files\n";
if (files.empty()) {
ROSBAG2_CPP_LOG_ERROR("No database files found for reindexing. Abort");
return;
throw std::runtime_error("No database files found for reindexing. Abort");
}

// Create initial metadata
Expand Down
5 changes: 0 additions & 5 deletions rosbag2_cpp/test/rosbag2_cpp/test_reindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ class ReindexTestFixture : public Test
target_dir = database_path + "/target_metadata";
}

// std::shared_ptr<NiceMock<MockStorage>> storage_;
// std::shared_ptr<StrictMock<MockConverterFactory>> converter_factory_;
// std::unique_ptr<rosbag2_cpp::Reader> reader_;
// std::string storage_serialization_format_;
std::string database_path;
std::string target_dir;
// rosbag2_storage::StorageOptions default_storage_options_;
};

TEST_F(ReindexTestFixture, test_multiple_files) {
Expand Down

0 comments on commit afb7c82

Please sign in to comment.