DISPLAYLEVEL(3, "test%3i : ZSTD_compressSequencesAndLiterals : ", testNb++);
{
- const size_t srcSize = 500 KB;
+ const size_t srcSize = 497000;
const BYTE* const src = (BYTE*)CNBuffer;
BYTE* const dst = (BYTE*)compressedBuffer;
const size_t dstCapacity = ZSTD_compressBound(srcSize);
goto _output_error;
}
}
+ { ZSTD_frameHeader zfh;
+ size_t const zfhStatus = ZSTD_getFrameHeader(&zfh, dst, compressedSize);
+ if (zfhStatus != 0) {
+ DISPLAY("Error reading frame header\n");
+ goto _output_error;
+ }
+ if (zfh.frameContentSize != srcSize) {
+ DISPLAY("Error: ZSTD_compressSequencesAndLiterals() did not report srcSize in the frame header\n");
+ goto _output_error;
+ }
+ if (zfh.windowSize > srcSize) {
+ DISPLAY("Error: ZSTD_compressSequencesAndLiterals() did not resized window size to smaller contentSize\n");
+ goto _output_error;
+ }
+ }
{ size_t const dSize = ZSTD_decompress(decompressBuffer, decompressSize, dst, compressedSize);
if (ZSTD_isError(dSize)) {
DISPLAY("Error during decompression of frame produced by ZSTD_compressSequencesAndLiterals()\n");