From 53b5314d6853f89681f1b89bda88545bb2de2348 Mon Sep 17 00:00:00 2001 From: Kwarde Date: Mon, 21 Jul 2025 17:35:59 +0200 Subject: [PATCH] Fix expected return value for 1st printf test --- src/tests.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests.asm b/src/tests.asm index 0f57d5f..b5036cd 100644 --- a/src/tests.asm +++ b/src/tests.asm @@ -207,7 +207,7 @@ section .rodata putsStr db "Howdy, environment!",EOS ;printf() addTestHeader(_printf, "printf") - addTest(printf_invalid, "printf(''H%ell%0 T\\%t\he%%%re%\n'')") ;=> Should be 'H%ell%0 T\\%t\he%re%' => 20 (+1 for NL) (yes, aware of the fact that '%0' is printed as '0' at the time of writing) + addTest(printf_invalid, "printf(''H%ell%0 T\\%t\he%%%re%\n'')") ;=> Should be 'H%ell%0 T\\%t\he%%re%' => 21 (+1 for NL) (yes, aware of the fact that '%0' is printed as '0' at the time of writing) printfStr1 db "H%ell%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 @@ -564,7 +564,7 @@ _start: xor rdx, rdx xor rcx, rcx call printf - assert_eq(21) + assert_eq(22) ; TEST 2 (print hexadecimal numbers in multiple possible ways) printTest(printf_hexpadd)