tests-util: Adding test to verify "allow-negative" flag
authorSwen Schillig <swen@linux.ibm.com>
Mon, 3 Jun 2019 08:13:52 +0000 (10:13 +0200)
committerRalph Boehme <slow@samba.org>
Sun, 30 Jun 2019 11:32:18 +0000 (11:32 +0000)
commited533debc40f3173326c65a90ae344d01ec1d427
tree8f5515f78342e48d9742fcae1050f592b7a8c485
parent1756cea95b844f99ae583860ee022ed56cf09aad
tests-util: Adding test to verify "allow-negative" flag

The standard string to integer conversion routines allow strings
with a leading "-" to indicate a negative number.
However, the returned value is always an unsigned value representing
the bit-pattern of this negative value.
Typically, this behaviour is NOT wanted and therefore the standard
behavior of the internal smb_strtoul(l) return an erros in such situations.
It can be enabled though by using the flag SMB_STR_ALLOW_NEGATIVE.
This test verifies the correct processing.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
lib/util/tests/util.c