Re: [PATCH v2 next 10/11] selftests/nolibc: Increase coverage of printf format tests
From: Thomas Weißschuh
Date: Mon Feb 16 2026 - 15:14:51 EST
On 2026-02-06 19:11:20+0000, david.laight.linux@xxxxxxxxx wrote:
> From: David Laight <david.laight.linux@xxxxxxxxx>
>
> Extra tests include:
> - %%, including ignored modifiers.
> - Invalid formats copied to output buffer (matches glibc).
> - Left aligned output "%-..."
> - Zero padding "%0...".
> - "(nil)" for NULL pointers (matches glibc).
> - Alternate form "%#x" (prepends 0x in non-zero).
> - Field precision as well as width, printf("%.0d", 0) is "".
> - Variable length width and precision "%*.*d".
> - Length qualifiers L and ll.
> - Conversion specifiers i and X.
> - More 'corner' cases.
>
> There are no explicit tests of long (l, t or z) because they would
> have to differ between 32bit and 64bit.
>
> Set the expected length to zero for all the non-truncating tests.
> (Annoying when a test is changed.)
New tests, yeah!
But as mentioned in my other responses I'd like the new tests to be part
of the patches introducing the new features. (Or of course a patch
introducing new tests for the existing features).
Also all tests should explicitly specify the return values.
So in the end this patch should probably be gone away completely.
Thomas