Skip to content

Commit

Permalink
Address review concern
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-hbrhbr committed Dec 20, 2024
1 parent dcb843e commit b20162f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ auto Compressor::open(FileWriter& file_writer) -> void {
m_compressed_stream_block_buffer.size()
))
{
throw OperationFailed(ErrorCode_NotInit, __FILENAME__, __LINE__);
throw OperationFailed(ErrorCode_NoMem, __FILENAME__, __LINE__);
}
m_compressed_stream_file_writer = &file_writer;
m_uncompressed_stream_pos = 0;
Expand Down Expand Up @@ -153,7 +153,7 @@ auto Compressor::flush_stream_output_block_buffer() -> void {
m_compressed_stream_block_buffer.size()
))
{
throw OperationFailed(ErrorCode_NotInit, __FILENAME__, __LINE__);
throw OperationFailed(ErrorCode_NoMem, __FILENAME__, __LINE__);
}
}

Expand Down
7 changes: 7 additions & 0 deletions components/core/tests/test-StreamingCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,20 @@ using std::string_view;
namespace {
constexpr string_view cCompressedFilePath{"test_streaming_compressed_file.bin"};
constexpr size_t cBufferSize{128L * 1024 * 1024}; // 128MB
// Interleave no-ops to ensure the integrity of the compressor states at all times.
constexpr auto cCompressionChunkSizes = std::to_array<size_t>(
{cBufferSize / 100,
0,
cBufferSize / 50,
0,
cBufferSize / 25,
0,
cBufferSize / 10,
0,
cBufferSize / 5,
0,
cBufferSize / 2,
0,
cBufferSize}
);

Expand Down

0 comments on commit b20162f

Please sign in to comment.