Skip to content

Commit

Permalink
Clarify unit test early termination
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-hbrhbr committed Dec 2, 2024
1 parent 559485d commit 7c69c69
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/core/tests/test-StreamingCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#include <memory>
#include <numeric>
#include <string>
#include <utility>

#include <boost/filesystem/operations.hpp>
#include <boost/pointer_cast.hpp>
#include <Catch2/single_include/catch2/catch.hpp>
#include <zstd.h>

Expand Down Expand Up @@ -78,12 +80,16 @@ TEST_CASE("StreamingCompression", "[StreamingCompression]") {
compressor->close();
file_writer.close();

// Decompress and compare
if (nullptr == decompressor) {
if (boost::dynamic_pointer_cast<clp::streaming_compression::lzma::Compressor>(
std::move(compressor)
))
{
// TODO: remove this LZMA testing early termination
boost::filesystem::remove(compressed_file_path);
return;
}

// Decompress and compare
clp::ReadOnlyMemoryMappedFile const memory_mapped_compressed_file{compressed_file_path};
auto const compressed_file_view{memory_mapped_compressed_file.get_view()};
decompressor->open(compressed_file_view.data(), compressed_file_view.size());
Expand Down

0 comments on commit 7c69c69

Please sign in to comment.