mirror of
https://github.com/facebook/zstd.git
synced 2025-12-04 00:04:23 -05:00
Add streaming decompression to unit test
This commit is contained in:
parent
c2c9b8a7ec
commit
17222654bf
@ -2382,6 +2382,14 @@ static int basicUnitTests(U32 const seed, double compressibility)
|
||||
CHECK_Z( ZSTD_DCtx_refDDict(dctx, ddictTable[i]));
|
||||
}
|
||||
CHECK_Z( ZSTD_decompressDCtx(dctx, decodedBuffer, CNBuffSize, compressedBuffer, cSize) );
|
||||
/* Streaming decompression should also work */
|
||||
{
|
||||
ZSTD_inBuffer in = {compressedBuffer, cSize, 0};
|
||||
ZSTD_outBuffer out = {decodedBuffer, CNBuffSize, 0};
|
||||
while (in.pos < in.size) {
|
||||
CHECK_Z(ZSTD_decompressStream(dctx, &out, &in));
|
||||
}
|
||||
}
|
||||
ZSTD_freeDCtx(dctx);
|
||||
for (i = 0; i < numDicts; ++i) {
|
||||
ZSTD_freeCDict(cdictTable[i]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user