• Home
  • Raw
  • Download

Lines Matching refs:blockSize

377         int const blockSize  = (FUZ_rand(&randState) % (FUZ_MAX_BLOCK_SIZE-1)) + 1;  in FUZ_test()  local
378 …st blockStart = (int)(FUZ_rand(&randState) % (U32)(COMPRESSIBLE_NOISE_LENGTH - blockSize - 1)) + 1; in FUZ_test()
386 U32 const crcOrig = XXH32(block, (size_t)blockSize, 0); in FUZ_test()
393 && ((size_t)blockSize < labSize) ) { in FUZ_test()
394 memcpy(lowAddrBuffer, block, blockSize); in FUZ_test()
400 { int cSize, srcSize = blockSize; in FUZ_test()
407 … FUZ_CHECKTEST(srcSize > blockSize, "LZ4_compress_destSize() read more than src buffer !"); in FUZ_test()
408 … DISPLAYLEVEL(5, "destSize : %7i/%7i; content%7i/%7i ", cSize, targetSize, srcSize, blockSize); in FUZ_test()
429 { int cSize, srcSize = blockSize; in FUZ_test()
437 compressionLevel, cSize, targetSize, srcSize, blockSize); in FUZ_test()
441 … FUZ_CHECKTEST(srcSize > blockSize, "LZ4_compress_HC_destSize() fed more than src buffer !"); in FUZ_test()
462 …HCcompressedSize = LZ4_compress_HC(block, compressedBuffer, blockSize, (int)compressedBufferSize, … in FUZ_test()
467 …{ int const r = LZ4_compress_HC_extStateHC(stateLZ4HC, block, compressedBuffer, blockSize, (int)… in FUZ_test()
473 …4_compress_HC_extStateHC_fastReset(stateLZ4HC, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
479 …{ int const r = LZ4_compress_fast_extState(stateLZ4, block, compressedBuffer, blockSize, (int)co… in FUZ_test()
484 …LZ4_compress_fast_extState_fastReset(stateLZ4, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
489 …compressedSize = LZ4_compress_default(block, compressedBuffer, blockSize, (int)compressedBufferSiz… in FUZ_test()
509 { int const r = LZ4_decompress_fast(cBuffer_exact, decodedBuffer, blockSize); in FUZ_test()
513 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
519 decodedBuffer[blockSize-1] = 0; in FUZ_test()
520 { int const r = LZ4_decompress_fast(cBuffer_exact, decodedBuffer, blockSize-1); in FUZ_test()
523 …FUZ_CHECKTEST(decodedBuffer[blockSize-1]!=0, "LZ4_decompress_fast overrun specified output buffer"… in FUZ_test()
527 { int const r = LZ4_decompress_fast(cBuffer_exact, decodedBuffer, blockSize+1); in FUZ_test()
533 decodedBuffer[blockSize] = 0; in FUZ_test()
534 … { int const r = LZ4_decompress_safe(cBuffer_exact, decodedBuffer, compressedSize, blockSize); in FUZ_test()
536 FUZ_CHECKTEST(r!=blockSize, "LZ4_decompress_safe did not regenerate original data"); in FUZ_test()
538 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe overrun specified output buffer size"… in FUZ_test()
539 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
545 decodedBuffer[blockSize] = 0; in FUZ_test()
546 decodedBuffer[blockSize+1] = 0; in FUZ_test()
547 … { int const r = LZ4_decompress_safe(cBuffer_exact, decodedBuffer, compressedSize, blockSize+1); in FUZ_test()
549 FUZ_CHECKTEST(r!=blockSize, "LZ4_decompress_safe did not regenerate original data"); in FUZ_test()
551 …FUZ_CHECKTEST(decodedBuffer[blockSize+1], "LZ4_decompress_safe overrun specified output buffer siz… in FUZ_test()
552 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
558 decodedBuffer[blockSize-1] = 0; in FUZ_test()
559 … { int const r = LZ4_decompress_safe(cBuffer_exact, decodedBuffer, compressedSize, blockSize-1); in FUZ_test()
562 …FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe overrun specified output buffer siz… in FUZ_test()
566 if (blockSize>10) { in FUZ_test()
567 decodedBuffer[blockSize-10] = 0; in FUZ_test()
568 … { int const r = LZ4_decompress_safe(cBuffer_exact, decodedBuffer, compressedSize, blockSize-10); in FUZ_test()
571 …FUZ_CHECKTEST(decodedBuffer[blockSize-10], "LZ4_decompress_safe overrun specified output buffer si… in FUZ_test()
601 memcpy(decodedBuffer+blockSize, &endMark, sizeof(endMark)); in FUZ_test()
602 …st decompressResult = LZ4_decompress_safe(cBuffer_exact, decodedBuffer, compressedSize, blockSize); in FUZ_test()
604 …sult > blockSize, "LZ4_decompress_safe on noisy src : result is too large : %u > %u (dst buffer)",… in FUZ_test()
606 { U32 endCheck; memcpy(&endCheck, decodedBuffer+blockSize, sizeof(endCheck)); in FUZ_test()
615 … int const r = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize-1, blockSize); in FUZ_test()
616 …being one byte too short (blockSize=%i, result=%i, compressedSize=%i)", blockSize, r, compressedSi… in FUZ_test()
621 decodedBuffer[blockSize] = 0; in FUZ_test()
622 … int const r = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize+1, blockSize); in FUZ_test()
625 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe overrun specified output buffer size"… in FUZ_test()
629 { size_t const missingOutBytes = FUZ_rand(&randState) % (unsigned)blockSize; in FUZ_test()
630 int const targetSize = (int)((size_t)blockSize - missingOutBytes); in FUZ_test()
634 …ult = LZ4_decompress_safe_partial(compressedBuffer, decodedBuffer, inCSize, targetSize, blockSize); in FUZ_test()
636 …al did not regenerated required amount of data (%i < %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
637 …artial overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
643 { size_t const missingOutBytes = FUZ_rand(&randState) % (unsigned)blockSize; in FUZ_test()
644 int const targetSize = (int)((size_t)blockSize - missingOutBytes); in FUZ_test()
648 …s_safe_partial_usingDict(compressedBuffer, decodedBuffer, inCSize, targetSize, blockSize, NULL, 0); in FUZ_test()
650 …ct did not regenerated required amount of data (%i < %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
651 …ngDict overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
656 { size_t const missingOutBytes = FUZ_rand(&randState) % (unsigned)blockSize; in FUZ_test()
657 int const targetSize = (int)((size_t)blockSize - missingOutBytes); in FUZ_test()
661 …partial_usingDict(compressedBuffer, decodedBuffer, inCSize, targetSize, blockSize, decodedBuffer, … in FUZ_test()
663 …ct did not regenerated required amount of data (%i < %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
664 …ngDict overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
669 { size_t const missingOutBytes = FUZ_rand(&randState) % (unsigned)blockSize; in FUZ_test()
670 int const targetSize = (int)((size_t)blockSize - missingOutBytes); in FUZ_test()
674 …partial_usingDict(compressedBuffer, decodedBuffer, inCSize, targetSize, blockSize, dict, dictSize); in FUZ_test()
676 …ct did not regenerated required amount of data (%i < %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
677 …ngDict overwrite beyond requested size (though %i <= %i <= %i)", decResult, targetSize, blockSize); in FUZ_test()
685 ret = LZ4_compress_default(block, compressedBuffer, blockSize, compressedSize); in FUZ_test()
690 … ret = LZ4_compress_fast_extState(stateLZ4, block, compressedBuffer, blockSize, compressedSize, 1); in FUZ_test()
695 … ret = LZ4_compress_HC(block, compressedBuffer, blockSize, HCcompressedSize, compressionLevel); in FUZ_test()
700 …ret = LZ4_compress_HC_extStateHC(stateLZ4HC, block, compressedBuffer, blockSize, HCcompressedSize,… in FUZ_test()
709 …{ int const cSize = LZ4_compress_default(block, compressedBuffer, blockSize, compressedSize-miss… in FUZ_test()
721 …{ int const hcSize = LZ4_compress_HC(block, compressedBuffer, blockSize, HCcompressedSize-missin… in FUZ_test()
737 …ize = LZ4_compress_fast_continue (&LZ4_stream, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
744 …ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer+dictSize, blockSize, decodedBu… in FUZ_test()
746 { U32 const crcCheck = XXH32(decodedBuffer+dictSize, (size_t)blockSize, 0); in FUZ_test()
753 …(compressedBuffer, decodedBuffer+dictSize, blockContinueCompressedSize, blockSize, decodedBuffer, … in FUZ_test()
754 … FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); in FUZ_test()
755 { U32 const crcCheck = XXH32(decodedBuffer+dictSize, (size_t)blockSize, 0); in FUZ_test()
764 …ize = LZ4_compress_fast_continue(&LZ4dictBody, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
769 …ret = LZ4_compress_fast_continue(&LZ4dictBody, block, compressedBuffer, blockSize, blockContinueCo… in FUZ_test()
774blockSize, (const void *)block, (void *)decodedBuffer, (const void *)dict, dictSize); in FUZ_test()
776 …ret = LZ4_compress_fast_continue(&LZ4dictBody, block, compressedBuffer, blockSize, blockContinueCo… in FUZ_test()
783 blockSize, (void *)decodedBuffer, (const void *)dict, dictSize); in FUZ_test()
784 decodedBuffer[blockSize] = 0; in FUZ_test()
785 … ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize, dict, dictSize); in FUZ_test()
787 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_fast_usingDict overrun specified output bu… in FUZ_test()
788 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
795 decodedBuffer[blockSize] = 0; in FUZ_test()
796 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); in FUZ_test()
797 … FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); in FUZ_test()
798 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output bu… in FUZ_test()
799 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
804 decodedBuffer[blockSize-1] = 0; in FUZ_test()
805 … ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize-1, dict, dictSize); in FUZ_test()
807 …FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_fast_usingDict overrun specified output … in FUZ_test()
810 decodedBuffer[blockSize-1] = 0; in FUZ_test()
811 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-1, dict, dictSiz… in FUZ_test()
813 …FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe_usingDict overrun specified output … in FUZ_test()
817 if (blockSize > missingBytes) { in FUZ_test()
818 decodedBuffer[blockSize-missingBytes] = 0; in FUZ_test()
819 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-missingBytes, di… in FUZ_test()
821 …fer[blockSize-missingBytes], "LZ4_decompress_safe_usingDict overrun specified output buffer size (… in FUZ_test()
831 …ize = LZ4_compress_fast_continue(&LZ4dictBody, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
839 …Size = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
853 …ret = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, blockContinueCom… in FUZ_test()
860 …ret = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, blockContinueCom… in FUZ_test()
869 …ret = LZ4_compress_fast_continue(&LZ4_stream, block, compressedBuffer, blockSize, blockContinueCom… in FUZ_test()
878 decodedBuffer[blockSize] = 0; in FUZ_test()
879 … ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize, dict, dictSize); in FUZ_test()
881 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_fast_usingDict overrun specified output bu… in FUZ_test()
882 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
889 decodedBuffer[blockSize] = 0; in FUZ_test()
890 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); in FUZ_test()
891 … FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); in FUZ_test()
892 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output bu… in FUZ_test()
893 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
898 decodedBuffer[blockSize-1] = 0; in FUZ_test()
899 … ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize-1, dict, dictSize); in FUZ_test()
901 …FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_fast_usingDict overrun specified output … in FUZ_test()
904 decodedBuffer[blockSize-1] = 0; in FUZ_test()
905 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-1, dict, dictSiz… in FUZ_test()
907 …FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe_usingDict overrun specified output … in FUZ_test()
911 if (blockSize > missingBytes) { in FUZ_test()
912 decodedBuffer[blockSize-missingBytes] = 0; in FUZ_test()
913 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-missingBytes, di… in FUZ_test()
915 …fer[blockSize-missingBytes], "LZ4_decompress_safe_usingDict overrun specified output buffer size (… in FUZ_test()
924 …ssedSize = LZ4_compress_HC_continue(LZ4dictHC, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
930 …ret = LZ4_compress_HC_continue(LZ4dictHC, block, compressedBuffer, blockSize, blockContinueCompres… in FUZ_test()
936 …ret = LZ4_compress_HC_continue(LZ4dictHC, block, compressedBuffer, blockSize, blockContinueCompres… in FUZ_test()
942 decodedBuffer[blockSize] = 0; in FUZ_test()
943 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); in FUZ_test()
944 … FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); in FUZ_test()
945 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output bu… in FUZ_test()
946 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
959 …dSize = LZ4_compress_HC_continue(LZ4_streamHC, block, compressedBuffer, blockSize, (int)compressed… in FUZ_test()
966 …ret = LZ4_compress_HC_continue(LZ4_streamHC, block, compressedBuffer, blockSize, blockContinueComp… in FUZ_test()
973 …ret = LZ4_compress_HC_continue(LZ4_streamHC, block, compressedBuffer, blockSize, blockContinueComp… in FUZ_test()
981 …ret = LZ4_compress_HC_continue(LZ4_streamHC, block, compressedBuffer, blockSize, blockContinueComp… in FUZ_test()
991 decodedBuffer[blockSize] = 0; in FUZ_test()
992 …usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); in FUZ_test()
993 … FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); in FUZ_test()
994 …FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output bu… in FUZ_test()
995 { U32 const crcCheck = XXH32(decodedBuffer, (size_t)blockSize, 0); in FUZ_test()
1003 { int const availableSpace = (int)(FUZ_rand(&randState) % (U32)blockSize) + 5; in FUZ_test()
1004 int consumedSize = blockSize; in FUZ_test()
1010 … consumedSize, blockSize, blockContinueCompressedSize, availableSpace, compressionLevel); in FUZ_test()
1013 … FUZ_CHECKTEST(consumedSize > blockSize, "LZ4_compress_HC_continue_destSize read overflow"); in FUZ_test()
1030 assert(blockSize >= 0); in FUZ_test()
1031 bytes += (unsigned)blockSize; in FUZ_test()
1354 { size_t const blockSize = 1 MB; in FUZ_unitTests() local
1356 void* const block = malloc(blockSize); in FUZ_unitTests()
1362 memset(block, 0, blockSize); in FUZ_unitTests()
1366 assert(blockSize < INT_MAX); in FUZ_unitTests()
1367 srcSize = (int)blockSize; in FUZ_unitTests()