Update printf test 1; Add '%9l'; I realized that I fixed '%0(invalid)' but that in the same scenario, non-zero would still cause that specific bug

This commit is contained in:
2025-07-24 22:19:31 +02:00
parent 5c395894c6
commit bb69efcc37

View File

@@ -228,8 +228,8 @@ section .rodata
putsStr db "Howdy, environment!",EOS
;printf()
addTestHeader(_printf, "printf")
addTest(printf_invalid, "printf(''H%ell%0 T\\%t\he%%%re%\n'')") ;'H%ell%0 T\\%t\he%%re%' => 21 (+1 for NL)
printfStr1 db "H%ell%0 T\\%t\he%%%re%\n",EOS
addTest(printf_invalid, "printf(''H%e%9ll%0 T\\%t\he%%%re%\n'')") ;'H%e%9ll%0 T\\%t\he%%re%' => 23 (+1 for NL)
printfStr1 db "H%e%9ll%0 T\\%t\he%%%re%\n",EOS
addTest(printf_hexpadd, "printf(''%x | %16x | %016x | %#16x | %#016x\n%X | %016X | %16X | %#016X | %#16X\n'', 80181775710, [... same arg 9 more times])")
printfStr2 db "%x | %16x | %016x | %#16x | %#016x\n%X | %016X | %16X | %#016X | %#16X\n",EOS
addTest(printf_ppadd, "printf(''%p | %16p | %016p | %#16p | %#016p\n%p | %016p | %16p | %#016p | %#16p\n'', 80181775710, [... same arg 9 more times])")
@@ -653,7 +653,7 @@ _start:
xor rdx, rdx
xor rcx, rcx
call printf
assert_eq(22)
assert_eq(24)
; TEST 2 (print hexadecimal numbers in multiple possible ways)
printTest(printf_hexpadd)