]> git.ipfire.org Git - thirdparty/haproxy.git/commit
TESTS: add a unit test for the multi-byte range checks
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Apr 2024 14:02:46 +0000 (16:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Apr 2024 14:05:38 +0000 (16:05 +0200)
commit048f1689d14c26e899e08a3bab1f48d520378680
tree411277e47dc6267bd2ceefeef5f3fa0d91e26ebb
parent13515d9fbe9abe7525f00edfc1612146d1fca2ec
TESTS: add a unit test for the multi-byte range checks

The test scans the whole number space in 32 bits and compares the different
functions with the reference that does one byte at a time. In 64-bit mode,
it picks 2^32 64-bit random numbers and tests that they the 64-bit functions
all produce the expected results when submitted such numbers.

It optionally takes an initial offset and step so that it can run on
multiple cores (or even machines), though the test is reasonably fast
on modern machines, around 10s per core.
tests/unit/test-int-range.c [new file with mode: 0644]