Alexandre Julliard : msvcrt/tests: Fix the %n format test for Vista.
Alexandre Julliard
julliard at winehq.org
Thu Sep 4 08:27:04 CDT 2008
Module: wine
Branch: master
Commit: 3e78cca50c75dbb0e3f7c16596c41385371c884e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3e78cca50c75dbb0e3f7c16596c41385371c884e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Sep 4 12:27:29 2008 +0200
msvcrt/tests: Fix the %n format test for Vista.
---
dlls/msvcrt/tests/printf.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c
index 040c4a7..1603893 100644
--- a/dlls/msvcrt/tests/printf.c
+++ b/dlls/msvcrt/tests/printf.c
@@ -390,9 +390,18 @@ static void test_sprintf( void )
format = "asdf%n";
x = 0;
r = sprintf(buffer, format, &x );
- ok(x == 4, "should write to x: %d\n", x);
- ok(!strcmp(buffer,"asdf"), "failed\n");
- ok( r==4, "return count wrong: %d\n", r);
+ if (r == -1)
+ {
+ /* %n format is disabled by default on vista */
+ /* FIXME: should test with _set_printf_count_output */
+ ok(x == 0, "should not write to x: %d\n", x);
+ }
+ else
+ {
+ ok(x == 4, "should write to x: %d\n", x);
+ ok(!strcmp(buffer,"asdf"), "failed\n");
+ ok( r==4, "return count wrong: %d\n", r);
+ }
format = "%-1d";
r = sprintf(buffer, format,2);
More information about the wine-cvs
mailing list