mirror of
https://github.com/facebook/zstd.git
synced 2025-10-17 00:07:08 -04:00
Merge pull request #7 from ephiepark/decodecorpus
reflect code review comments
This commit is contained in:
commit
01f5b5d918
@ -1225,22 +1225,12 @@ static int basicUnitTests(U32 seed, double compressibility)
|
|||||||
outBuff.size = CNBufferSize;
|
outBuff.size = CNBufferSize;
|
||||||
outBuff.pos = 0;
|
outBuff.pos = 0;
|
||||||
|
|
||||||
while (inBuff.pos < inBuff.size) {
|
CHECK(ZSTD_decompressStream(zds, &outBuff, &inBuff) != 0,
|
||||||
CHECK_Z( ZSTD_decompressStream(zds, &outBuff, &inBuff) );
|
"Decompress did not reach the end of frame");
|
||||||
}
|
CHECK(inBuff.pos != inBuff.size, "Decompress did not fully consume input");
|
||||||
|
CHECK(outBuff.pos != decompressedSize, "Decompressed size does not match");
|
||||||
{ XXH64_state_t xxhStateIn, xxhStateOut;
|
CHECK(memcmp(outBuff.dst, decompressed, decompressedSize) != 0,
|
||||||
U32 checkIn, checkOut;
|
"Decompressed data does not match");
|
||||||
XXH64_reset(&xxhStateIn, 0);
|
|
||||||
XXH64_reset(&xxhStateOut, 0);
|
|
||||||
|
|
||||||
XXH64_update(&xxhStateIn, decompressed, decompressedSize);
|
|
||||||
XXH64_update(&xxhStateOut, outBuff.dst, outBuff.pos);
|
|
||||||
|
|
||||||
checkIn = (U32)XXH64_digest(&xxhStateIn);
|
|
||||||
checkOut = (U32)XXH64_digest(&xxhStateOut);
|
|
||||||
CHECK(checkIn != checkOut, "Checksum does not match");
|
|
||||||
}
|
|
||||||
|
|
||||||
ZSTD_freeDStream(zds);
|
ZSTD_freeDStream(zds);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user