From 524fe1d1cbd30d4b9839dfe58428b2590c1a102c Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Sun, 22 Dec 2024 17:21:00 -0500 Subject: [PATCH] Change all instances of programming-error-induced error codes to ErrorCode_Failure --- .../core/src/clp/streaming_compression/lzma/Compressor.cpp | 6 +++--- components/core/tests/test-StreamingCompression.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/core/src/clp/streaming_compression/lzma/Compressor.cpp b/components/core/src/clp/streaming_compression/lzma/Compressor.cpp index a9fa0d5a0..34c1a0e2b 100644 --- a/components/core/src/clp/streaming_compression/lzma/Compressor.cpp +++ b/components/core/src/clp/streaming_compression/lzma/Compressor.cpp @@ -26,7 +26,7 @@ auto Compressor::open(FileWriter& file_writer) -> void { m_compressed_stream_block_buffer.size() )) { - throw OperationFailed(ErrorCode_NoMem, __FILENAME__, __LINE__); + throw OperationFailed(ErrorCode_Failure, __FILENAME__, __LINE__); } m_compressed_stream_file_writer = &file_writer; m_uncompressed_stream_pos = 0; @@ -38,7 +38,7 @@ auto Compressor::close() -> void { } if (m_lzma_stream.avail_in() > 0) { - throw OperationFailed(ErrorCode_Corrupt, __FILENAME__, __LINE__); + throw OperationFailed(ErrorCode_Failure, __FILENAME__, __LINE__); } flush_lzma(LZMA_FINISH); @@ -153,7 +153,7 @@ auto Compressor::flush_stream_output_block_buffer() -> void { m_compressed_stream_block_buffer.size() )) { - throw OperationFailed(ErrorCode_NoMem, __FILENAME__, __LINE__); + throw OperationFailed(ErrorCode_Failure, __FILENAME__, __LINE__); } } diff --git a/components/core/tests/test-StreamingCompression.cpp b/components/core/tests/test-StreamingCompression.cpp index 22582cff2..9f0df9306 100644 --- a/components/core/tests/test-StreamingCompression.cpp +++ b/components/core/tests/test-StreamingCompression.cpp @@ -35,7 +35,7 @@ namespace { constexpr string_view cCompressedFilePath{"test_streaming_compressed_file.bin"}; constexpr size_t cBufferSize{128L * 1024 * 1024}; // 128MB constexpr auto cCompressionChunkSizes = std::to_array( - {0, // no-op + {0, cBufferSize / 100, cBufferSize / 50, cBufferSize / 25,