Martin Storsjo : ucrtbase: Add a test for snprintf to a NULL buffer.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 6 09:06:33 CST 2015


Module: wine
Branch: master
Commit: 5e2f6fa9a38d2719e9d6980514a2b83dd397e7a0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5e2f6fa9a38d2719e9d6980514a2b83dd397e7a0

Author: Martin Storsjo <martin at martin.st>
Date:   Fri Nov  6 12:20:44 2015 +0200

ucrtbase: Add a test for snprintf to a NULL buffer.

Signed-off-by: Martin Storsjo <martin at martin.st>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ucrtbase/tests/printf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/ucrtbase/tests/printf.c b/dlls/ucrtbase/tests/printf.c
index 6c719ea..d3ed0a2 100644
--- a/dlls/ucrtbase/tests/printf.c
+++ b/dlls/ucrtbase/tests/printf.c
@@ -156,6 +156,9 @@ static void test_snprintf (void)
         ok (buffer[valid] == '\0',
             "\"%s\": Missing null termination (ret %d) - is %d\n", fmt, n, buffer[valid]);
     }
+
+    ok (vsprintf_wrapper (UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, "abcd") == 4,
+        "Failure to snprintf to NULL\n");
 }
 
 static int __cdecl vswprintf_wrapper(unsigned __int64 options, wchar_t *str,




More information about the wine-cvs mailing list