]> git.kaiwu.me - haproxy.git/commit
REGTESTS: converter: add a test for the arithmetic and bitwise converters
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:01:55 +0000 (20:01 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:26:01 +0000 (16:26 +0200)
commit90112fea20b599fe8453f1516995a3745a1d0a92
tree0aa7d234cc5202a9087e7eaef2d7697ab0ccb23e
parent0d157919df45b888a50dccb41ef23952a3734da0
REGTESTS: converter: add a test for the arithmetic and bitwise converters

None of the integer converters was covered by a reg-test so far. This
test checks add, sub, mul, div, mod, neg, cpl, and, or, xor, not, bool,
odd, even, htonl and hex2i at once, using the "int()" fetch as an input
so that no server nor client data is needed.

The operand of add, sub and div is also passed as a variable so that
both the constant and the variable forms are covered, and the documented
behavior of a null divisor is verified for div() and mod().

Note that hex2i() currently fails on a non-hexadecimal input instead of
returning zero as documented, the test matches the implementation.
reg-tests/converter/arith.vtc [new file with mode: 0644]