Commit Graph

263 Commits

Author SHA1 Message Date
gstedman
98a86c8ef6 Add multiframe report to --list command 2019-05-15 21:13:19 +01:00
Dmitry V. Levin
0d3f85df65 test-amalgamation: split the rule
Change test-amalgamation to follow each-rule-makes-a-single-target idiom.

Fixes: a7e8d394 ("[amalgamation] add test")
2019-04-23 21:18:11 +00:00
Dmitry V. Levin
8069d2ae6f test-amalgamation: fix compilation options
Use the same compilation options to compile lz4_all.c and other object files.

Fixes: a7e8d394 ("[amalgamation] add test")
2019-04-23 21:18:11 +00:00
Dmitry V. Levin
10726d4c56 test-amalgamation: use a single cat command
Use the list of prerequisites instead of listing those files manually,
this way they will never fall out of sync.

Also update the amalgamation example to use a single cat command.

Fixes: a7e8d394 ("[amalgamation] add test")
Fixes: b192c86b ("[amalgamation] lz4frame.c")
2019-04-23 21:18:11 +00:00
Dmitry V. Levin
7937e86255 test-amalgamation: fix the list of prerequisites
Add $(LZ4DIR)/lz4frame.c to the list of prerequisites as the rule uses
that file.

Fixes: b192c86b ("[amalgamation] lz4frame.c")
2019-04-23 21:18:11 +00:00
JPeterMugaas
7136489d33 More build imrpvements
Moved a few other tests to Makefiles.inc.  Other things might need to go there.
Made a test for symlink appropriateness.  Windows can NOT handle them the same way Unix-like operating systems do (if at all).  This is mostly the same as the Visual C projects.
embed version info into .dll and .exes that are redistributed.
2019-04-23 07:44:00 -04:00
Yann Collet
291b3d8b7e
Merge pull request #691 from lz4/list
--list
2019-04-22 17:43:01 -07:00
Yann Collet
c4fe7a2047
Merge pull request #689 from JPeterMugaas/jpm-makefile
Jpm makefile - as described in https://github.com/lz4/lz4/issues/688
2019-04-22 15:29:50 -07:00
Yann Collet
0d4c885abb refactored --list function
better handling of special conditions,
better scoping of variables.

Also : updated man page
2019-04-22 14:01:19 -07:00
JPeterMugaas
2acddd9918 Fix a test for mingw 2019-04-22 16:06:04 -04:00
JPeterMugaas
b48f823f90 Try to put some tests I made in ONE place. I also moved a test for "install" in one place to try to isolate it. 2019-04-22 15:48:48 -04:00
JPeterMugaas
773b66547f Initial commits from diff I submitted earlier 2019-04-22 13:48:59 -04:00
Yann Collet
22fae16c6f ensure tests work when stdout is not the console
ensure this case is continuously tested on travis.

Update documentation on implicit output,
invite to not rely on implicit output in scripts.
2019-04-21 17:01:03 -07:00
Yann Collet
467e352de9 tests/Makefile : created CMP variable
for potential redirection, if need be.

note : should probably converge all comparison operations onto CMP
2019-04-21 12:42:13 -07:00
Yann Collet
5f8ac02b77 cli: display a warning whenever default output is stdout while input != stdin
This behavior has been preserved for compatibility with existing ecosystem.
But it's problematic, as some environment start `lz4` without identifying stdout as console by default,
leading to a change of behavior for a same line of script.

A more sensible policy would be to default to stdout only when input is stdin.

Soft change for the time being : keep the behavior, just print a warning message.
User should prefer `-c` to explicitly select `stdout`.

Also : updated tests in Makefile to explicitly select `stdout` with `-c`.
2019-04-19 17:08:40 -07:00
Yann Collet
ae199124e5 fixed read-after input in LZ4_decompress_safe() 2019-04-18 18:50:51 -07:00
Yann Collet
4790994568 fuzzer : reduced stack usage 2019-04-18 17:12:14 -07:00
Yann Collet
6cb084ed36 fuzzer: reduce stack usage to please Visual static analyzer 2019-04-18 17:01:36 -07:00
Yann Collet
0b876db6d4 address a few minor Visual warnings
and created target cxx17build
2019-04-18 16:07:16 -07:00
Yann Collet
4f6de46f60 fix several minor static analyzer warnings 2019-04-18 12:05:50 -07:00
Yann Collet
3f558163ad fuzzer: fixed scan-build leak warning
the program exit(),
so there is no need to track and dealloc every buffer.
2019-04-18 10:38:51 -07:00
Yann Collet
8f0e744063 fuzzer: fix explicit cast for C++ 2019-04-17 15:44:14 -07:00
Yann Collet
1ed69691a1 fuzzer: added tests to detect LZ4_decompress_fast() out of bound read 2019-04-17 13:31:24 -07:00
Norm Green
1848ea5cbd Fix AIX errors/warnings 2019-04-17 09:20:09 -07:00
Yann Collet
0d4a974639 Merge branch 'dev' into fixframe 2019-04-15 11:18:33 -07:00
Yann Collet
ac5d2629c1 added a fake initialization to please an analyzer
which is unable to understand that the variable is necessarily initialized
in spite of an assert just before.
2019-04-15 11:17:35 -07:00
Yann Collet
ce0f316989 fix fuzzer tests on dirty context
context is no longer dirty after a failed compressed block.
Actually, all indexes are fine.
It remains compatible with continued streaming, and reset*_fast().
2019-04-15 11:12:54 -07:00
Yann Collet
98e5c0062f added more margin for canary in frametest 2019-04-15 10:44:46 -07:00
Yann Collet
3ab916c6a2 frametest: removed uninitialized warning
was a false positive, but better remove it anyway
2019-04-15 10:14:36 -07:00
Yann Collet
9c41e5804e assert() the failed test
ensure canary remains within buffer limits
2019-04-15 02:11:59 -07:00
Yann Collet
c222dd9010 fixed frametest
One test could write a canary value out of bound
in exceptional conditions involving multiple flushes
triggered by -s3421 -t462948.
2019-04-15 01:54:40 -07:00
Yann Collet
63bfb64b80 and even more visual conversion warnings 2019-04-12 17:40:23 -07:00
Yann Collet
c7554c3004 fixed minor Visual conversion warnings 2019-04-12 17:03:28 -07:00
Yann Collet
9c49e3ca07 added tests for -d -m -c
seems to work properly
2019-04-12 16:10:55 -07:00
Yann Collet
e865a3e7ec fixed lz4 -m -c
can compress multiple files into stdout
2019-04-12 15:17:48 -07:00
Yann Collet
20c2a5fc94 added command -BI for "Independent Blocks"
This is the reverse of `-BD`, and the current default.

This command can be useful to reverse a previous `-BD` command.
It may in the future be more important
if `lz4` switches to generating dependent blocks by default.
2019-04-12 13:27:11 -07:00
Yann Collet
9e501702bd made LZ4F_getHeaderSize() public 2019-04-09 18:10:58 -07:00
Yann Collet
d8d5f14138 fixed loadDictHC
by making a full initialization
instead of a fast reset.
2019-04-09 15:37:59 -07:00
Yann Collet
14c71dfa9c modified LZ4_initStreamHC() to look like LZ4_initStream()
it is now a pure initializer, for statically allocated states.
It can initialize any memory area, and because of this, requires size.
2019-04-09 13:55:42 -07:00
Yann Collet
da19cc79da checkFrame: removed %zu
not liked by mingw
2019-04-08 14:21:09 -07:00
Yann Collet
b92681f3c0 fullbench: assert lz4_stream_t initialization 2019-04-08 14:10:59 -07:00
Yann Collet
3f5f10c63e fixed cleaning tmp directory 2019-04-08 14:01:32 -07:00
Yann Collet
249703ae2e slightly faster huge file test
level down 5->4
size down 6G->5G
2019-04-08 13:49:26 -07:00
Yann Collet
5db9a2f8b6 added make list target to tests 2019-04-08 13:45:01 -07:00
Yann Collet
2ece0d8380 created LZ4_initStream()
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()

note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
2019-04-05 12:56:26 -07:00
Yann Collet
2a94faf462 fixed _GNU_SOURCE duplicate 2019-04-05 11:55:34 -07:00
Yann Collet
a4f1635b0a fuzzer: fixed strict c99 with mmap+MAP_ANONYMOUS 2019-04-05 11:47:06 -07:00
Yann Collet
c491df54ec created LZ4_initStreamHC()
- promoted LZ4_resetStreamHC_fast() to stable
- moved LZ4_resetStreamHC() to deprecated (but do not generate a warning yet)
- Updated doc, to highlight difference between init and reset
- switched all invocations of LZ4_resetStreamHC() onto LZ4_initStreamHC()
- misc: ensure `make all` also builds /tests
2019-04-04 17:05:11 -07:00
Yann Collet
7a39fb8fb6 make _fast*() decoder generate a deprecation warning
updated modification
2019-04-04 12:47:36 -07:00
Tim Zakian
9028682e7a Fix pass-through mode 2019-01-10 10:20:17 -08:00