Commit Graph

454 Commits

Author SHA1 Message Date
Yann Collet
88e477db6b fix 1308
PR #1308 introduces a new symbol, `LZ4_compress_fast_extState_destSize()`,
which, upon inspection, doesn't seem to work as advertised.
In particular, it fails if `dstCapacity` is not large enough,
as opposed to adjusting input size to fit within `dstCapacity`.

Even if it had worked, it would have resulted in problems
for the existing `LZ4_compress_fast_extState()`,
that would have stopped failing when `dstCapacity` is not large enough,
resulting in silent input truncation.

Changed the approach.
It appears the wanted functionality already exists within `lz4` source code,
and is called `LZ4_compress_destSize_extState()`.
It wasn't exposed dues to a (non-verified) problem regarding lz4 state on exit:
it's claimed that since the `_destSize` doesn't completely consume the input,
the state may end up in an "unfinished" status,
making it dangerous to re-employ in later invocations.

Fixed that by enforcing a state initialization at the end of operation.

Also : added some tests,
ensure that `LZ4_compress_fast_extState()` fails as expected when `dstCapacity` is not large enough,
and ensure that `LZ4_compress_destSize_extState()` does succeed in the same circumstance,
by consume less input.

Finally, expose `LZ4_compress_destSize_extState()` as an advanced experimental symbol.
2023-12-27 20:56:27 -08:00
Yann Collet
efd7029a18 create local_LZ4_decompress_safe() to circumvent dllimport warning
Visual Studio only
2023-12-26 00:41:41 -08:00
Yann Collet
467db788e1 make arrays static 2023-12-26 00:27:56 -08:00
Yann Collet
f239a17a6b fix read when requesting out-of-range codec 2023-12-26 00:11:47 -08:00
Yann Collet
ded75e76ea fixed minor conversion warning 2023-12-26 00:02:03 -08:00
Yann Collet
a03e877bfd fullbench: -i0 runs a very fast (but still measured) run
as opposed to just listing, as it did before,
which is now convered by -l and -h.
2023-12-25 23:57:40 -08:00
Yann Collet
f5d14ab9e5 can list algorithms to benchmark
with -l (list only) or as part of -h and -H
2023-12-25 21:00:39 -08:00
Yann Collet
d7674fad29 Merge branch 'makefile' into fasterfbench 2023-12-25 20:53:18 -08:00
Yann Collet
df3b602a94 array for benched compressors 2023-12-25 11:37:03 -08:00
Yann Collet
fde31574e5 fullbench: record benched decompressors into a C90 array
will make listing possible.
2023-12-25 07:56:30 -08:00
Yann Collet
a0abf19ecb fixed -j for versionsTest
Apparently, the `-j` flag for `make` manages to get passed to even a `make` started by python.
2023-12-24 21:09:03 -08:00
Yann Collet
5c9e349c4a changed test name cpp->cxx
cpp evokes the C PreProcessor, rather than C++
2023-12-24 17:09:52 -08:00
Yann Collet
dd7e99917b rename variable LIBDIR for consistency 2023-12-24 16:00:21 -08:00
Yann Collet
7b7cecd14a fix attempt for ppc64 test on circleci 2023-12-23 01:05:53 -08:00
Yann Collet
cecb7f0491 versionsTest: pass variables via MOREFLAGS
for older versions of `lz4` that may require it
2023-12-22 23:33:42 -08:00
Yann Collet
669e2559d3 add traces to versionsTest 2023-12-22 23:02:11 -08:00
Yann Collet
736bcf76d6 minor CI adjustments 2023-12-22 20:32:30 -08:00
Yann Collet
48db0b23e4 abiTests fixes 2023-12-22 12:00:19 -08:00
Yann Collet
a467d7eb33 abiTest : add more traces and messages 2023-12-22 11:19:56 -08:00
Yann Collet
63e73c152e adding traces to abiTest to better observe potential issues 2023-12-22 10:29:16 -08:00
Yann Collet
bbe41f4039 attempt to fix abi Test 2023-12-22 00:52:12 -08:00
Yann Collet
6b5f56629e adjust speed python test 2023-12-22 00:45:53 -08:00
Yann Collet
e760561c8a adjust test-lz4-speed for absence of MOREFLAGS 2023-12-22 00:35:22 -08:00
Yann Collet
da955d7160 streamlines tests/Makefile clean logic
also:
- stricter (more complete) .PHONY declaration
2023-12-21 22:09:54 -08:00
Yann Collet
06b2287804 very minor conversion warning fix
and ignore more build artifacts
2023-12-21 14:01:39 -08:00
Yann Collet
dc474bd84a fix minor conversion warnings
appearing with clang-17
2023-12-19 23:11:29 -08:00
Yann Collet
cd7ce04a09 missing clean target 2023-12-17 15:26:53 -08:00
Yann Collet
ac8d683af6 removed x32 tests from inter-version-abi-test 2023-09-26 09:39:57 -07:00
Yann Collet
e79d3c31ed update frame fuzzer to be able to generate bug1227 2023-09-11 19:38:03 -07:00
Yann Collet
f10aaa0af4 created new test case bug1227
and shipped the associated fix,
as suggested by @QrczakMK
2023-09-11 19:10:11 -07:00
Yann Collet
2acbb0f1a4 minor unitTests refactor 2023-09-11 17:49:08 -07:00
Yann Collet
ea7a371571 minor frametest refactoring 2023-09-11 17:38:39 -07:00
Yann Collet
9a03570692 update comment on @.stableDst parameter 2023-09-11 14:03:37 -07:00
Yann Collet
eaae7159a2 frametest: added RAND_BITS() macro 2023-09-11 13:48:26 -07:00
Laszlo Dobcsanyi
b9343a6871 Change test to decompress-partial that has no dependencies 2023-09-02 22:06:34 +02:00
Laszlo Dobcsanyi
2afd92539d Add test cmake project and CI integration 2023-09-02 21:51:14 +02:00
Dimitri Papadopoulos
cfee8d501e
Apply pyupgrade suggestion to Python test scripts
Inheritance from `object` is implicit in Python 3.
2023-08-13 19:37:39 +02:00
Dimitri Papadopoulos
13c508ea15
Discard trailing spaces 2023-06-25 17:43:56 +02:00
Dimitri Papadopoulos
bdfe4c0c98
Enclose by a do-while loop to avoid possible if/else logic defects 2023-06-25 17:43:51 +02:00
Takayuki Matsuoka
eeb33d10b0 fix: workaround for false positive analysis from MSVC v17.6 (part 2)
Same as d678159c64
2023-05-20 22:21:44 +09:00
Yann Collet
45a4880b9c refuse to compress directories
fix #1211, reported by @imba-tjd
2023-02-26 10:40:28 -08:00
Yann Collet
d879e7f15a
Merge pull request #1187 from t-mat/pr-issue-1186
Add environment check for freestanding test : resolves #1186
2022-12-02 14:46:24 -08:00
Takayuki Matsuoka
95d703ae41 Remove PATH=$(PATH) prefix from all shell script invocation
When $(PATH) contains ' ' (space, 0x20), this prefix causes error.
Also we don't need reconfiguring PATH for each shell script, we don't need them.

This changeset fixes issue #1195
2022-11-29 09:25:42 +09:00
Takayuki Matsuoka
08f1483b0a Add environment check for freestanding test
Freestanding test is intended to run on only Linux x86_64 platform.
Because it uses Linux x86_64 syscall directly to avoid any dependency to the standard library.

This changeset adds platform checking code to tests/Makefile to avoid unintended
error in non-Linux x86_64 platforms.

This changeset resolves issue #1186
2022-11-09 23:42:03 +09:00
Tristan Partin
198e532300
Update Meson build to 1.9.4
Specifically this adds support for the following options:

- LZ4_ALIGN_TEST
- LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION
- LZ4_DISTANCE_MAX
- LZ4_FAST_DEC_LOOP
- LZ4_FORCE_SW_BITCOUNT
- LZ4_FREESTANDING
- LZ4_USER_MEMORY_FUNCTIONS
- compiling ossfuzz targets
- compiling more test targets
- registering some tests
2022-10-19 23:27:05 -05:00
Yann Collet
251e04a9c1 added test able to catch bug #1167
also : errors during benchmark mode return an error code.
2022-09-15 16:48:28 -07:00
Yann Collet
3c1d5812af add a test to catch issue #1164
where `--test -m files*.lz4` would create a bunch of `files*` files.
`--test` should not create any file.

It turns out the bug was already fixed when #1164 was filled,
but it also shows that the CI system was blind to such issues when it happened.

The new test was run with `v1.9.3` and triggered an error, as expected.
2022-09-14 11:13:07 -07:00
Yann Collet
2822825845 added LZ4F_compressUpdate() in fullbench 2022-09-07 23:51:30 -07:00
Takayuki Matsuoka
ff4b136ab8 Fix: replace strtoull with _strtoui64 for MSVC2010
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strtoui64-wcstoui64-strtoui64-l-wcstoui64-l
2022-08-13 03:59:49 +09:00
Takayuki Matsuoka
f7e95939e8 Fix: remove unused value
This patch fixes the following error from "make staticAnalyze"

datagencli.c:106:21: warning: Value stored to 'size' is never read
                    size=0;
                    ^    ~
2022-08-13 00:46:44 +09:00