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.
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
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
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
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.