summaryrefslogtreecommitdiffstats
path: root/tests/frametest.c
Commit message (Collapse)AuthorAgeFilesLines
* added options.skipChecksums to local fuzzer testYann Collet2022-07-291-0/+1
|
* Merge pull request #1115 from lz4/lz4f_customMemYann Collet2022-07-161-4/+63
|\ | | | | Support for Custom Memory managers
| * implemented LZ4F_createCDict_advanced()Yann Collet2022-07-131-2/+9
| |
| * Merge branch 'dev' into lz4f_customMemYann Collet2022-07-131-3/+3
| |\
| * | implemented first custom memory manager interfaceYann Collet2022-07-131-4/+56
| | | | | | | | | | | | | | | | | | | | | for compression context only for the time being, using LZ4F_createCompressionContext_advanced(). Added basic test in frametest.c
* | | support skippable frames within pipeYann Collet2022-07-151-2/+0
| |/ |/| | | | | | | | | | | fix #977 fseek() doesn't work for pipe, switch to "read and forget" mode in such case.
* | fix stricter enum type requirements for C++Yann Collet2022-07-131-3/+3
|/
* update frametest for new condition for uncompressedUpdateYann Collet2022-07-051-13/+10
|
* added fuzzer test for LZ4F_uncompressedUpdate in frametestYann Collet2022-07-011-12/+29
|
* Introduce MIN and MAX bounds to LZ4_MEMORY_USAGEYann Collet2022-01-311-9/+10
| | | | | | | ensure that `frametest` works fine with these values, notably with low LZ4_MEMORY_USAGE (dict test notably) following suggestions from @t-mat at #1016
* Fix typos found by codespellDimitri Papadopoulos2021-11-251-1/+1
|
* fix UB lz4:988 and lz4:1178Yann Collet2021-05-281-1/+4
| | | | | ensure `dictBase` is only used when there is an actual dictionary content.
* updated license & header datesYann Collet2020-11-251-1/+1
|
* fixed minor Visual warningYann Collet2020-11-151-1/+1
| | | | doesn't happen on my environment, though it's a different version of Visual Studio
* better visual conformanceYann Collet2020-11-151-2/+1
| | | | | | only include <intrin.h> on vs2005+ (#947) remove some useless #pragma fix a few minor Visual warnings
* define sentinelTestYann Collet2020-10-021-2/+3
| | | | to help scan-build detect the condition
* make it possible to select SCANBUILD binary on command lineYann Collet2020-10-021-1/+1
|
* add LZ4F_decompress() tests with (NULL,0) input and outputYann Collet2020-10-021-1/+3
| | | | fix one (rare & complex) issue discovered by this test
* improved last literals run on LZ4_compress_destSizeYann Collet2020-09-281-8/+10
| | | | | | applying new more accurate formula from LZ4_compress_HC_destSize() also : fix some minor display issue in tests/frametest
* fixed lz4frame with blocks of size 1Yann Collet2020-09-171-2/+4
| | | | properly track history
* Clarifies and fix EndMarkYann Collet2020-08-131-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | EndMark, the 4-bytes value indicating the end of frame, must be `0x00000000`. Previously, it was just mentioned as a `0-size` block. But such definition could encompass uncompressed blocks of size 0, with a header of value `0x80000000`. But the intention was to also support uncompressed empty blocks. They could be used as a keep-alive signal. Note that compressed empty blocks are already supported, it's just that they have a size 1 instead of 0 (for the `0` token). Unfortunately, the decoder implementation was also wrong, and would also interpret a `0x80000000` block header as an endMark. This issue evaded detection so far simply because this situation never happens, as LZ4Frame always issues a clean 0x00000000 value as a endMark. It also does not flush empty blocks. This is fixed in this PR. The decoder can now deal with empty uncompressed blocks, and do not confuse them with EndMark. The specification is also clarified. Finally, FrameTest is updated to randomly insert empty blocks during fuzzing.
* add testsChristopher Harvie2020-05-141-0/+18
|
* fixed test errorv1.9.2Yann Collet2019-08-151-1/+1
| | | | | could trigger %0 on exceptional circumstances due to wrong buffer size parameter.
* ensure conformance with custom LZ4_DISTANCE_MAXYann Collet2019-07-151-1/+2
| | | | | | | | | | | | | | It's now possible to select a custom LZ4_DISTANCE_MAX at compile time, provided it's <= 65535. However, in some cases (when compressing in byU16 mode), the new distance wasn't respected, as it used to implied that it was necessarily within range. Added a distance check for this case. Also : added a new TravisCI test which ensures that custom LZ4_DISTANCE_MAX compiles correctly and compresses correctly (relying on `assert()` to find outsized offsets).
* fix minor cppcheck warningsYann Collet2019-06-301-1/+1
|
* updated frametestYann Collet2019-06-301-16/+27
| | | | | | so that noisy src decompression doesn't generate output nor fails when decompression fails (which is expected).
* frametest: added LZ4F decoder noise testYann Collet2019-06-301-83/+182
|
* address a few minor Visual warningsYann Collet2019-04-181-3/+4
| | | | and created target cxx17build
* fix several minor static analyzer warningsYann Collet2019-04-181-6/+8
|
* added a fake initialization to please an analyzerYann Collet2019-04-151-1/+1
| | | | | which is unable to understand that the variable is necessarily initialized in spite of an assert just before.
* added more margin for canary in frametestYann Collet2019-04-151-5/+4
|
* frametest: removed uninitialized warningYann Collet2019-04-151-17/+26
| | | | was a false positive, but better remove it anyway
* assert() the failed testYann Collet2019-04-151-0/+1
| | | | ensure canary remains within buffer limits
* fixed frametestYann Collet2019-04-151-10/+14
| | | | | | One test could write a canary value out of bound in exceptional conditions involving multiple flushes triggered by -s3421 -t462948.
* made LZ4F_getHeaderSize() publicYann Collet2019-04-101-3/+8
|
* fuzzer: fixed strict c99 with mmap+MAP_ANONYMOUSYann Collet2019-04-051-5/+4
|
* Fix C90 compatibility issueTim Zakian2019-01-091-1/+2
|
* Make LZ4F_getBlockSize public and publis in experimental sectionTim Zakian2019-01-091-0/+22
|
* clang: Fix -WcommaLzu Tao2018-12-021-1/+1
|
* added a test for LZ4F_compressEnd()Yann Collet2018-10-091-2/+12
| | | | | | | | | | | | | | | which actively tries to make it write out of bound. For this scenario to be possible, it's necessary to set dstCapacity < LZ4F_compressBound() When a compression operation fails, the CCtx context is left in an undefined state, therefore compression cannot resume. As a consequence : - round trip tests must be aborted, since there is nothing valid to decompress - most users avoid this situation, by ensuring that dstCapacity >= LZ4F_compressBound() For these reasons, this use case was poorly tested up to now.
* tried to clean another bunch of cppcheck warningsYann Collet2018-09-191-5/+6
| | | | | | | | | | | | so "funny" thing with cppcheck is that no 2 versions give the same list of warnings. On Mac, I'm using v1.81, which had all warnings fixed. On Travis CI, it's v1.61, and it complains about a dozen more/different things. On Linux, it's v1.72, and it finds a completely different list of a half dozen warnings. Some of these seems to be bugs/limitations in cppcheck itself. The TravisCI version v1.61 seems unable to understand %zu correctly, and seems to assume it means %u.
* added cppcheckYann Collet2018-09-181-2/+2
| | | | | | as Makefile target and Travis CI test. Fixed last cppcheck warnings in tests and examples
* small extDict : fixed side-effectYann Collet2018-05-061-0/+1
| | | | | | don't fix dictionaries of size 0. setting dictEnd == source triggers prefix mode, thus removing possibility to use CDict.
* fixed frametest errorYann Collet2018-05-061-2/+6
| | | | | | | | | | | | | | | | | | | | The error can be reproduced using following command : ./frametest -v -i100000000 -s1659 -t31096808 It's actually a bug in the stream LZ4 API, when starting a new stream and providing a first chunk to complete with size < MINMATCH. In which case, the chunk becomes a dictionary. No hash was generated and stored, but the chunk is accessible as default position 0 points to dictStart, and position 0 is still within MAX_DISTANCE. Then, next attempt to read 32-bits from position 0 fails. The issue would have been mitigated by starting from index 64 KB, effectively eliminating position 0 as too far away. The proper fix is to eliminate such "dictionary" as too small. Which is what this patch does.
* Multiply-Include Header to Check Guard Macro CorrectnessW. Felix Handte2018-04-241-0/+3
|
* Change Over Includes in the ProjectW. Felix Handte2018-04-241-1/+2
|
* Make LZ4F_compressFrame_usingCDict Take a Compression ContextW. Felix Handte2018-03-121-8/+11
|
* Add Bounds Check to locateBuffDiffW. Felix Handte2018-03-121-3/+5
|
* restored block checksum capability at lz4frame API levelYann Collet2017-08-121-2/+26
|
* implemented lz4frame decompression APIYann Collet2017-08-101-3/+64
|