advanced decompression function replaces by normal streaming one
advanced parameters compatible with ZSTD_decompressStream().
This commit is contained in:
+1
-1
@@ -1331,7 +1331,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
}
|
||||
{ ZSTD_inBuffer in = { compressedBuffer, cSize, 0 };
|
||||
ZSTD_outBuffer out = { decodedBuffer, CNBuffSize, 0 };
|
||||
size_t const result = ZSTD_decompress_generic(dctx, &out, &in);
|
||||
size_t const result = ZSTD_decompressStream(dctx, &out, &in);
|
||||
if (result != 0) goto _output_error;
|
||||
if (in.pos != in.size) goto _output_error;
|
||||
if (out.pos != inputSize) goto _output_error;
|
||||
|
||||
+1
-1
@@ -948,7 +948,7 @@ static size_t local_defaultDecompress(
|
||||
if(out.pos == out.size) {
|
||||
return (size_t)-ZSTD_error_dstSize_tooSmall;
|
||||
}
|
||||
moreToFlush = ZSTD_decompress_generic(dctx,
|
||||
moreToFlush = ZSTD_decompressStream(dctx,
|
||||
&out, &in);
|
||||
if (ZSTD_isError(moreToFlush)) {
|
||||
return moreToFlush;
|
||||
|
||||
+2
-2
@@ -691,7 +691,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
if (inBuff.pos != inBuff.size) goto _output_error;
|
||||
{ ZSTD_outBuffer decOut = {decodedBuffer, size, 0};
|
||||
ZSTD_inBuffer decIn = {outBuff.dst, outBuff.pos, 0};
|
||||
CHECK_Z( ZSTD_decompress_generic(dctx, &decOut, &decIn) );
|
||||
CHECK_Z( ZSTD_decompressStream(dctx, &decOut, &decIn) );
|
||||
if (decIn.pos != decIn.size) goto _output_error;
|
||||
if (decOut.pos != size) goto _output_error;
|
||||
{ U64 const crcDec = XXH64(decOut.dst, decOut.pos, 0);
|
||||
@@ -759,7 +759,7 @@ static int basicUnitTests(U32 seed, double compressibility)
|
||||
inBuff.src = compressedBuffer;
|
||||
inBuff.size = cSize;
|
||||
inBuff.pos = 0;
|
||||
CHECK_Z( ZSTD_decompress_generic(zd, &outBuff, &inBuff) );
|
||||
CHECK_Z( ZSTD_decompressStream(zd, &outBuff, &inBuff) );
|
||||
if (inBuff.pos != inBuff.size) goto _output_error; /* entire input should be consumed */
|
||||
if (outBuff.pos != CNBufferSize) goto _output_error; /* must regenerate whole input */
|
||||
DISPLAYLEVEL(3, "OK \n");
|
||||
|
||||
Reference in New Issue
Block a user