|| tableType == byPtr
|| inputSize >= 4 KB)
{
- DEBUGLOG(4, "Resetting table in %p", cctx);
+ DEBUGLOG(4, "LZ4_prepareTable: Resetting table in %p", cctx);
MEM_INIT(cctx->hashTable, 0, LZ4_HASHTABLESIZE);
cctx->currentOffset = 0;
cctx->tableType = clearedTable;
} else {
- DEBUGLOG(4, "Re-use hash table (no reset)");
+ DEBUGLOG(4, "LZ4_prepareTable: Re-use hash table (no reset)");
}
}
/* Encode Offset */
if (maybe_ext_memSegment) { /* static test */
+ DEBUGLOG(6, " with offset=%u (ext if > %i)", offset, (int)(ip - (const BYTE*)source));
assert(offset <= MAX_DISTANCE && offset > 0);
LZ4_writeLE16(op, (U16)offset); op+=2;
- DEBUGLOG(6, " with offset=%u (ext if > %i)", offset, (int)(ip - (const BYTE*)source));
} else {
+ DEBUGLOG(6, " with offset=%u (same segment)", (U32)(ip - match));
assert(ip-match <= MAX_DISTANCE);
LZ4_writeLE16(op, (U16)(ip - match)); op+=2;
- DEBUGLOG(6, " with offset=%u (same segment)", (U32)(ip - match));
}
/* Encode MatchLength */
matchCode += more;
ip += more;
}
- DEBUGLOG(6, " with matchLength=%u starting in extDict", matchCode+MINMATCH);
+ DEBUGLOG(6, " with matchLength=%u starting in extDict", matchCode+MINMATCH);
} else {
matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, matchlimit);
ip += MINMATCH + matchCode;
- DEBUGLOG(6, " with matchLength=%u", matchCode+MINMATCH);
+ DEBUGLOG(6, " with matchLength=%u", matchCode+MINMATCH);
}
if ( outputLimited && /* Check output buffer overflow */
void LZ4_resetStream (LZ4_stream_t* LZ4_stream)
{
- DEBUGLOG(5, "LZ4_resetStream %p", LZ4_stream);
+ DEBUGLOG(5, "LZ4_resetStream (ctx:%p)", LZ4_stream);
MEM_INIT(LZ4_stream, 0, sizeof(LZ4_stream_t));
}
} }
/* Compress using external dictionary stream */
- FUZ_DISPLAYTEST();
{
LZ4_stream_t LZ4_stream;
int expectedSize;
U32 expectedCrc;
+ FUZ_DISPLAYTEST("LZ4_compress_fast_continue() after LZ4_loadDict()");
LZ4_loadDict(&LZ4dict, dict, dictSize);
expectedSize = LZ4_compress_fast_continue(&LZ4dict, block, compressedBuffer, blockSize, (int)compressedBufferSize, 1);
FUZ_CHECKTEST(expectedSize<=0, "LZ4_compress_fast_continue reference compression for extDictCtx should have succeeded");
expectedCrc = XXH32(compressedBuffer, expectedSize, 0);
+ FUZ_DISPLAYTEST("LZ4_compress_fast_continue() after LZ4_attach_dictionary()");
LZ4_loadDict(&LZ4dict, dict, dictSize);
-
LZ4_resetStream(&LZ4_stream);
LZ4_attach_dictionary(&LZ4_stream, &LZ4dict);
blockContinueCompressedSize = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, (int)compressedBufferSize, 1);
FUZ_CHECKTEST(blockContinueCompressedSize != expectedSize, "LZ4_compress_fast_continue using extDictCtx produced different-sized output (%d expected vs %d actual)", expectedSize, blockContinueCompressedSize);
FUZ_CHECKTEST(XXH32(compressedBuffer, blockContinueCompressedSize, 0) != expectedCrc, "LZ4_compress_fast_continue using extDictCtx produced different output");
- FUZ_DISPLAYTEST();
+ FUZ_DISPLAYTEST("LZ4_compress_fast_continue() after LZ4_attach_dictionary(), but output buffer is 1 byte too short");
LZ4_resetStream(&LZ4_stream);
LZ4_attach_dictionary(&LZ4_stream, &LZ4dict);
ret = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, blockContinueCompressedSize-1, 1);