Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parametrized testing #1448

Open
wants to merge 133 commits into
base: develop
Choose a base branch
from
Open

Conversation

rhpvorderman
Copy link

@rhpvorderman rhpvorderman commented Mar 7, 2023

More tests is better. This simply tests if compressing a small data buffer with all possible combinations of settings is successful.

The test is a good addition, because it already finds one bug which I will make an issue for. EDIT: #1449

The C code works properly, I wonder how to best integrate this into the test suite.

nmoinvaz and others added 30 commits June 13, 2021 10:27
…on for output and window. In this instance if too many bytes are written it will not correctly write matches with distances close to the window size.
* There is no need to convert between unsigned and signed vector types. All relevant intrinsics have versions for all unsigned vector types.
* Using vdupq_n_u64 duplicates the unsigned 64-bit integer to two consecutive aligned memory locations in stack so compiler can use wider load instructions.
  All different-sized general-purpose registers overlay on ARM/AArch64, so any vector cast is no-op in assembly.
* chunkcopy() can read or write more than the safe length if the length is not multiple of chunk size.
- Fix inflate corruption on aarch64 zlib-ng#1008
- Fix MSVC warnings zlib-ng#1002 zlib-ng#1013
- Minor chunkset improvements zlib-ng#1000 zlib-ng#994 zlib-ng#1015
- Minor cleanup zlib-ng#997
- Add CI test for pigz on aarch64 zlib-ng#1004
- Cmake improvements zlib-ng#996
Without this patch, #include <zlib.h> with Z_SOLO defined
(e.g. while building perl 5.34.0) fails because of use of
undefined types.
Do not use relative includes, since they are valid only within the
source directory. Rely on the build system to pass the necessary
include flags instead.
Transition to Ubuntu 18.04 in `GitHub` actions workflows.

Fixes:
```
Ubuntu 16.04 Clang
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.

Ubuntu 16.04 GCC
This request was automatically failed because there were no enabled runners online to process the request for more than 1 days.
```

reported for example at:
https://github.com/zlib-ng/zlib-ng/actions/runs/1326434358

Official `GitHub` notice related to the removal of the 16.04 virtual
environments:
https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/
…ier.

* armv7 has partial support for unaligned reads, but compiler might use instructions that do not support unaligned accesses
Co-authored-by: concatime <concatime@users.noreply@github.com>
Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
tch69 and others added 23 commits December 27, 2022 13:49
inflate() does not update strm.adler with DFLTCC.
deflate() updates strm.adler even for raw streams.
Fix by adding wrap checks.
Removed tests for features not supported in 2.0.x:
- cxx related settings, as stable does not use gtest/gbench.
- Emscripten
- Add_subdirectory
- Symbol prefix
- oss-fuzz, their buildfile is incompatible with this branch
…n and congestion.

The free Github Actions VMs have 2 cores, the dedicated s390x VM has 4 cores.
…d the past < chunksize bytes in the window. See zlib-ng#1245.

Co-authored-by: Adam Stylinski <kungfujesus06@gmail.com>

Backported from commit c882034.
* Add __msan_unpoison() calls to DFLTCC inline assembly.
* Make parameter block sizes symbolic constants.
* Move dfltcc() definition after struct dfltcc_param_v0 definition.

Backported from commit 1f5ddcc.
gzsetparams() now returns a Z_STREAM_ERROR in this case.
memLevel 9 would cause deflateBound() to assume the use of fixed
blocks, even if the compression level was 0, which forces stored
blocks. That could result in a bound less than the size of the
compressed data. Now level 0 always uses the stored blocks bound.
A fixed block could be chosen when a stored block was smaller. Now
the smaller of the two is always chosen.
Changes since 2.0.6:
- Fix CVE-2022-37434 zlib-ng#1328
- Fix chunkmemset zlib-ng#1196
- Fix deflateBound too small zlib-ng#1236
- Fix Z_SOLO zlib-ng#1263
- Fix ACLE variant of crc32 zlib-ng#1274
- Fix inflateBack zlib-ng#1311
- Fix deflate_quick windowsize zlib-ng#1431
- Fix DFLTCC bugs related to adler32 zlib-ng#1349 and zlib-ng#1390
- Fix warnings zlib-ng#1194 zlib-ng#1312 zlib-ng#1362
- MacOS build fix zlib-ng#1198
- Add invalid windowBits handling zlib-ng#1293
- Support for Force TZCNT zlib-ng#1186
- Support for aligned_alloc() zlib-ng#1360
- Minideflate improvements zlib-ng#1175 zlib-ng#1238
- Dont use unaligned access for memcpy zlib-ng#1309
- Build system zlib-ng#1209 zlib-ng#1233 zlib-ng#1267 zlib-ng#1273 zlib-ng#1278 zlib-ng#1292 zlib-ng#1316 zlib-ng#1318 zlib-ng#1365
- Test improvements zlib-ng#1208 zlib-ng#1227 zlib-ng#1241 zlib-ng#1353
- Cleanup zlib-ng#1266
- Documentation zlib-ng#1205 zlib-ng#1359
- Misc improvements zlib-ng#1294 zlib-ng#1297 zlib-ng#1306 zlib-ng#1344 zlib-ng#1348
- Backported zlib fixes
- Backported CI workflows from Develop branch
@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (98ea610) 83.43% compared to head (f636a09) 83.40%.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           stable-pre-release    #1448      +/-   ##
======================================================
- Coverage               83.43%   83.40%   -0.03%     
======================================================
  Files                      76       76              
  Lines                    8872     8872              
  Branches                 2258     2258              
======================================================
- Hits                     7402     7400       -2     
- Misses                   1394     1399       +5     
+ Partials                   76       73       -3     
Flag Coverage Δ
macos_clang ∅ <ø> (∅)
macos_gcc 67.92% <ø> (ø)
ubuntu_clang 83.76% <ø> (ø)
ubuntu_clang_debug 83.69% <ø> (ø)
ubuntu_clang_inflate_allow_invalid_dist 83.48% <ø> (ø)
ubuntu_clang_inflate_strict 83.72% <ø> (ø)
ubuntu_clang_mmap 83.48% <ø> (ø)
ubuntu_clang_pigz 9.35% <ø> (ø)
ubuntu_clang_pigz_no_optim 9.97% <ø> (ø)
ubuntu_clang_pigz_no_threads 9.29% <ø> (ø)
ubuntu_clang_reduced_mem 83.76% <ø> (ø)
ubuntu_gcc 71.30% <ø> (ø)
ubuntu_gcc_aarch64 71.53% <ø> (ø)
ubuntu_gcc_aarch64_compat_no_opt 67.68% <ø> (ø)
ubuntu_gcc_aarch64_no_acle 67.88% <ø> (ø)
ubuntu_gcc_aarch64_no_neon 68.45% <ø> (ø)
ubuntu_gcc_armhf_compat_no_opt 67.62% <ø> (ø)
ubuntu_gcc_armhf_no_acle 71.74% <ø> (ø)
ubuntu_gcc_armhf_no_neon 72.24% <ø> (ø)
ubuntu_gcc_armsf 71.19% <ø> (ø)
ubuntu_gcc_armsf_compat_no_opt 70.99% <ø> (ø)
ubuntu_gcc_compat_no_opt 71.47% <ø> (ø)
ubuntu_gcc_compat_sprefix 71.26% <ø> (ø)
ubuntu_gcc_m32 70.92% <ø> (ø)
ubuntu_gcc_mingw_i686 70.83% <ø> (ø)
ubuntu_gcc_mingw_x86_64 70.93% <ø> (ø)
ubuntu_gcc_no_avx2 68.59% <ø> (ø)
ubuntu_gcc_no_ctz 72.14% <ø> (ø)
ubuntu_gcc_no_ctzll 71.85% <ø> (ø)
ubuntu_gcc_no_pclmulqdq 66.86% <ø> (ø)
ubuntu_gcc_no_sse2 67.97% <ø> (ø)
ubuntu_gcc_no_sse4 67.04% <ø> (ø)
ubuntu_gcc_o1 68.61% <ø> (ø)
ubuntu_gcc_osb ∅ <ø> (∅)
ubuntu_gcc_pigz 34.84% <ø> (-0.11%) ⬇️
ubuntu_gcc_pigz_aarch64 37.07% <ø> (-0.58%) ⬇️
ubuntu_gcc_ppc 71.80% <ø> (ø)
ubuntu_gcc_ppc64 72.24% <ø> (ø)
ubuntu_gcc_ppc64le 70.64% <ø> (ø)
ubuntu_gcc_ppc_no_power8 72.59% <ø> (ø)
ubuntu_gcc_s390x 72.57% <ø> (ø)
ubuntu_gcc_s390x_dfltcc 69.87% <ø> (ø)
ubuntu_gcc_s390x_dfltcc_compat 67.34% <ø> (ø)
ubuntu_gcc_s390x_no_crc32 72.57% <ø> (ø)
ubuntu_gcc_sparc64 72.13% <ø> (ø)
ubuntu_gcc_sprefix 70.96% <ø> (ø)
win64_gcc 70.72% <ø> (ø)
win64_gcc_compat_no_opt 71.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crc32.c 93.05% <0.00%> (-2.78%) ⬇️
gzlib.c 64.82% <0.00%> (ø)
gzread.c 67.78% <0.00%> (ø)
test/minideflate.c 57.77% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nmoinvaz
Copy link
Member

nmoinvaz commented Mar 7, 2023

We do something similar already in CMake by testing common compression levels and known failure cases. But this looks like it may cover more cases.

It would be best if this was incorporated into Google Test framework.
See Value-Parameterized Tests:
https://github.com/google/googletest/blob/main/docs/advanced.md

@Dead2 Dead2 added the Rebase needed Please do a 'git rebase develop yourbranch' label May 16, 2023
@Dead2 Dead2 changed the base branch from stable-pre-release to develop June 7, 2023 18:10
@Dead2
Copy link
Member

Dead2 commented Aug 14, 2023

@rhpvorderman This needs a rebase on develop, and it would also be nice if the tests were integrated into the existing test framework. Are these things you think you could do to get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes Requested Rebase needed Please do a 'git rebase develop yourbranch' Testing Framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet