Paul Vriens : gdi32/tests: Prevent a crash on win95.
Alexandre Julliard
julliard at winehq.org
Thu Sep 11 08:00:14 CDT 2008
Module: wine
Branch: master
Commit: c50d922ef6470c9ca4be7f13f163c5ffa91631b2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c50d922ef6470c9ca4be7f13f163c5ffa91631b2
Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date: Wed Sep 10 17:47:49 2008 +0200
gdi32/tests: Prevent a crash on win95.
---
dlls/gdi32/tests/icm.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/tests/icm.c b/dlls/gdi32/tests/icm.c
index 9d89828..b36165c 100644
--- a/dlls/gdi32/tests/icm.c
+++ b/dlls/gdi32/tests/icm.c
@@ -51,20 +51,28 @@ static void test_GetICMProfileA( HDC dc )
ret = GetICMProfileA( dc, &size, NULL );
ok( !ret, "GetICMProfileA succeeded\n" );
- ret = GetICMProfileA( dc, NULL, filename );
- ok( !ret, "GetICMProfileA succeeded\n" );
-
size = MAX_PATH;
ret = GetICMProfileA( NULL, &size, filename );
ok( !ret, "GetICMProfileA succeeded\n" );
size = 0;
+ filename[0] = 0;
SetLastError(0xdeadbeef);
ret = GetICMProfileA( dc, &size, filename );
error = GetLastError();
ok( !ret, "GetICMProfileA succeeded\n" );
ok( size, "expected size > 0\n" );
- ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error );
+ ok( filename[0] == 0, "Expected filename to be empty\n" );
+ ok( error == ERROR_INSUFFICIENT_BUFFER ||
+ error == ERROR_SUCCESS, /* Win95 */
+ "got %d, expected ERROR_INSUFFICIENT_BUFFER or ERROR_SUCCESS(Win95)\n", error );
+
+ /* Next test will crash on Win95 */
+ if ( error == ERROR_INSUFFICIENT_BUFFER )
+ {
+ ret = GetICMProfileA( dc, NULL, filename );
+ ok( !ret, "GetICMProfileA succeeded\n" );
+ }
size = MAX_PATH;
ret = GetICMProfileA( dc, &size, filename );
More information about the wine-cvs
mailing list