From 48eee77b51edc9fdedb3a753767a5bdcfcc90c0a Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 3 Sep 2023 23:13:55 +0200 Subject: [PATCH] tests: exercise `%b` printfrr format specifier Added by ISO C23 / N2630, implementation imported from FreeBSD. Signed-off-by: David Lamparter --- tests/lib/test_printfrr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/lib/test_printfrr.c b/tests/lib/test_printfrr.c index 0ab40b2ecd..66699ec7c0 100644 --- a/tests/lib/test_printfrr.c +++ b/tests/lib/test_printfrr.c @@ -166,6 +166,9 @@ int main(int argc, char **argv) printchk("-77385308584349683 18369358765125201933 feed1278cafef00d", "%Ld %Lu %Lx", ui64, ui64, ui64); + FMT_NSTD(printchk("11110000000011111010010111000011", "%b", 0xf00fa5c3)); + FMT_NSTD(printchk("0b01011010", "%#010b", 0x5a)); + inet_aton("192.168.1.2", &ip); printchk("192.168.1.2", "%pI4", &ip); printchk(" 192.168.1.2", "%20pI4", &ip);