summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-12-24IBM Z: Do not check inflateGetDictionary() with DFLTCCIlya Leoshkevich
The zlib manual does not specify a strict contract for inflateGetDictionary(), it merely says that it "Returns the sliding dictionary being maintained by inflate", which is an implementation detail. IBM Z inflate's behavior differs from that of software, and may change in the future to boot.
2021-12-24Fix deflateBound and compressBound returning very small size estimates.Hans Kristian Rosbach
Remove workaround in switchlevels.c, so we do actual testing of this. Use named defines instead of magic numbers where we can.
2021-12-24Avoid warning C4295 when using Visual C++ and maintainer warnings are enabled.Mika Lindqvist
2021-12-24Use helper function for printing error and exiting in example.Nathan Moinvaziri
2021-12-24Fixed minideflate write buffers being overwritten.Nathan Moinvaziri
2021-12-24Include win directory in pigz even if not using threads.Nathan Moinvaziri
2021-12-24Fill out gzheader before calling deflateSetHeader for better code coverage ↵Nathan Moinvaziri
in example.
2021-12-24Added unit test to ensure that inflate with adler32 hash works on previously ↵Nathan Moinvaziri
failed test case.
2021-12-24Added code coverage for inflateGetDictionary in example.Nathan Moinvaziri
2021-12-24Call deflateBound to calculate length with custom gzip header in example.Nathan Moinvaziri
2021-12-24Add new crc32 unit testMatheus Castanho
2021-06-21Fix MSVC warnings in hash_head_0.c testIlya Leoshkevich
2021-06-21Added Z_UNUSED define for ignore unused variables.Nathan Moinvaziri
2021-06-08Added pigz tests for no threads and no optimizations.Nathan Moinvaziri
2021-06-08Added GH-979 failure test case against for inflateBack.Nathan Moinvaziri
2021-06-08Added CMake project for building pigz.Nathan Moinvaziri
Added GitHub Actions CI for testing pigz.
2021-05-30Fixed trying to uncompress after compressing in gzip direct mode which is ↵Nathan Moinvaziri
not supported by gz functions. https://oss-fuzz.com/testcase-detail/6194422837542912
2021-05-30Fixed gz mode for compression level not using ascii numeric value.Nathan Moinvaziri
2021-05-30Use different fuzzer bits in example_dict_fuzzer for more input value ↵Nathan Moinvaziri
combinations.
2021-05-27Fix build under Cygwin.Mika Lindqvist
2021-05-16Spelling fixesGreg Sjaardema
2021-05-08upgrade links to HTTPSViktor Szakats
http://infozip.sourceforge.net/ is sadly not having HTTPS access enabled. Shoutout to somebody with admin access for this project: It would be nice to enable it and thus allowing secure access to these pages via https://infozip.sourceforge.io/ . The option has been there for a while now: https://sourceforge.net/blog/introducing-https-for-project-websites/ also: - follow permanent redirects - add ending slashes
2021-04-28Added Z_FIXED and direct gzip out modes to minigzip fuzzer.Nathan Moinvaziri
2021-04-28Changed minigzip fuzzer outmode[3] to be determined based on a different ↵Nathan Moinvaziri
value then outmode[2] for better coverage.
2021-04-20Remove unnecessary malloc.h header include from minigzip and minigzip_fuzzer.Nathan Moinvaziri
2021-03-22Fix MSVC warnings in deflate_quick_block_openIlya Leoshkevich
Add casts in order to fix the following warnings [1]: C:\Users\Nathan\Source\zlib-ng\test\deflate_quick_block_open.c(62,69): warning C4244: '=': conversion from '__int64' to 'uint32_t', possible loss of data [C:\Users\Nathan\Source\zlib-ng\deflate_quick_block_open.vcxproj] C:\Users\Nathan\Source\zlib-ng\test\deflate_quick_block_open.c(73,1): warning C4244: 'initializing': conversion from '_ _int64' to 'uint32_t', possible loss of data [C:\Users\Nathan\Source\zlib-ng\deflate_quick_block_open.vcxproj] [1] https://github.com/zlib-ng/zlib-ng/pull/880#issuecomment-802432700
2021-03-20Restore hash_head != 0 checksIlya Leoshkevich
Commit bc5915e2dec7 ("Fixed unsigned integer overflow ASAN error when hash_head > s->strstart.") removed hash_head != 0 checks in fast, medium and slow deflate, because it improved performance [1]. Unfortunately, the attached test started failing after that. Apparently, as the comments suggest, the code implicitly relies on matches with the beginning of the window being skipped. So restore the check. [1] https://github.com/zlib-ng/zlib-ng/pull/772#issuecomment-710760300
2021-03-17Fix block_open handling in deflate_quick()Ilya Leoshkevich
The attached test fails with "inflate() failed", because the deflate stream that it produces ends up being corrupted. Bisect points to the commit e7bb6db09a18 ("Replace hash_bits, hash_size and hash_mask with defines."), but it's most likely a coincidence. In any case, the reason is that if we happen to simultaneously exhaust all the buffers (in, out and bi), we return finish_started without writing the end of block symbol, which will never happen afterwards. Fix by adding another check to the tricky condition: if we are in the middle of a block, return need_more instead of finish_started.
2021-03-16Fix bi_valid handling in deflate_quick()Ilya Leoshkevich iii@linux.ibm.com
The attached test started failing after commit ad89d5131b29 ("Don't write end of last block when returning finish_started."): either with "bi_buf not flushed" message in debug builds, or by producing corrupted output in release builds. The problem is that we must not return finish_started when bi_buf is not empty, because the bits there will be lost. Fix by checking that bi_valid is not 0.
2021-01-28Always canonicalize CHOST when building original zlib even after automatic ↵Nathan Moinvaziri
CHOST detection.
2021-01-12Update abicheck git commit referenceHans Kristian Rosbach
2020-11-10Fixed coverity dereference after null check in gz_compress CID 303796.Nathan Moinvaziri
2020-11-02Fixed minigzip_fuzzer not compiling on latest macOS due to missing ↵Nathan Moinvaziri
_POSIX_C_SOURCE.
2020-10-09Fix switchlevels calling deflateParams() with a stale bufferIlya Leoshkevich
Fixes: #776
2020-10-09Fix memory leak in gz_compress() and add NULL check.Mika Lindqvist
2020-10-09Fix memory leak in gz_uncompress().Mika Lindqvist
2020-10-09Fixed dereference of possibly null head variable in test_deflate_set_header.Nathan Moinvaziri
example.c:920:16: warning: dereference of possibly-NULL ‘head’ [CWE-690] [-Wanalyzer-possible-null-dereference] 920 | head->text = 1; | ~~~~~~~~~~~^~~ ‘test_deflate_set_header’: event 1 | | 906 | PREFIX(gz_header) *head = calloc(1, sizeof(PREFIX(gz_header))); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) this call could return NULL
2020-09-22Fixed deference null return value in gz_uncompress (CID 301524)Nathan Moinvaziri
2020-09-19Remove chunkmemset_3 and chunkmemset_6 on ARM/AArch64 as they need 3 chunks...Mika Lindqvist
* Don't unroll distances smaller than chunk size.
2020-09-16Add missing z_const to fuzzers.Mika Lindqvist
2020-09-14Fixed buf resource leak in gz_compress when USE_MMAP is defined. (CID 298965)Nathan Moinvaziri
2020-09-03test/abicheck.md: document care and feeding of abicheck.shDan Kegel
2020-09-03test/abicheck.sh: new script to verify abi compatibility with older versionsDan Kegel
Verifies that zlib-ng's ABI has not changed since the reference commit (indicated by variables ABI_URL and ABI_COMMIT in the script). If --zlib-compat is given, the reference commit is zlib's 1.2.11; otherwise, it's zlib-ng's 1d2504ddc489 (for now). Ignores new symbols entirely, as they probably don't break backwards compatibility. Ignores warnings listed in test/abi/ignore, currently, just those related to internal_state or z_stream*. If --refresh is given, actually checks out the reference commit, builds it, and stores its ABI description into an .abi file; otherwise just uses the .abi file saved in git for that CHOST. (--refresh_if is similar, but only does the above if the file is not present.) Fixes https://github.com/zlib-ng/zlib-ng/issues/699 Known issues: - pkgcheck.yml skips -m32 abicheck failures loudly until #705 is fixed - although abicheck.sh supports -m32 (if in both CFLAGS and LDFLAGS), it doesn't yet support -32 in CONFIGURE_ARGS. - only includes a few abi definitions; the rest can be added in a followon commit (see --refresh).
2020-08-23Reintroduce support for ZLIB_CONST in compat mode. (#704)Mika Lindqvist
* Reintroduce support for ZLIB_CONST in compat mode.
2020-08-20Fix testsuite warnings on Windows, using PRIu64Josh Triplett
zlib-ng already counts on inttypes.h and stdint.h, so use those to avoid printf-related warnings by casting integer fields whose size may vary to uint64_t and printing them that way.
2020-08-14Fixed possible loss of data warning in h2b in infcover on Windows.Nathan Moinvaziri
infcover.c(247,35): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
2020-08-14Fixed warning about indexing literal string in GCC macOSNathan Moinvaziri
infcover.c:378:56: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] infcover.c:378:56: note: use array indexing to silence this warning
2020-07-17CMakeLists.txt, configure: match source order; .so's now identical on more ↵Dan Kegel
platforms. Also: - use same name for .so on CMake and configure in --zlib-compat case - configure: merge i686 and x86_64 sections, since they were essentially identical - pkgcheck.sh: verify resulting shared libraries are bit-for-bit identical - pkgcheck.sh: use diffoscope if present to show differences in shared libraries Don't install diffoscope in ci, since that slows down successful runs; we can add it later if failures become common. Fixes #638 (at least for the systems tested)
2020-07-13Make static libraries produced by cmake and configure identical.Dan Kegel
Also make compat mode .pc files identical. - cmake: don't do runtime feature checks when doing native builds. - test/pkgcheck.sh: also compare .a, check compat mode, and handle mac better - CMakeLists.txt: get Version right in compat mode .pc file - .github/workflows/pkgcheck.sh: test on more systems, including mac Fixes #681
2020-07-12Fixed warning about implicit declaration of function fileno().Nathan Moinvaziri