Mikołaj Zalewski : comdlg32/tests: Make sure no ANSI strings are passed to Unicode functions.
Alexandre Julliard
julliard at winehq.org
Sat Jun 21 05:39:18 CDT 2008
Module: wine
Branch: master
Commit: 2879c39d4fbe50ebbab96345a6d32a4f098e6a26
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2879c39d4fbe50ebbab96345a6d32a4f098e6a26
Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date: Fri Jun 20 23:03:20 2008 +0200
comdlg32/tests: Make sure no ANSI strings are passed to Unicode functions.
---
dlls/comdlg32/tests/filedlg.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c
index abceb15..bd7689f 100644
--- a/dlls/comdlg32/tests/filedlg.c
+++ b/dlls/comdlg32/tests/filedlg.c
@@ -86,6 +86,24 @@ static void test_DialogCancel(void)
ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",
CDERR_INITIALIZATION, CommDlgExtendedError());
+ result = GetSaveFileNameA(&ofn);
+ ok(0 == result, "expected %d, got %d\n", 0, result);
+ ok(0 == CommDlgExtendedError(), "expected %d, got %d\n", 0,
+ CommDlgExtendedError());
+
+ PrintDlgA(NULL);
+ ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",
+ CDERR_INITIALIZATION, CommDlgExtendedError());
+
+ /* Before passing the ofn to Unicode functions, remove the ANSI strings */
+ ofn.lpstrFilter = NULL;
+ ofn.lpstrInitialDir = NULL;
+ ofn.lpstrDefExt = NULL;
+
+ PrintDlgA(NULL);
+ ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",
+ CDERR_INITIALIZATION, CommDlgExtendedError());
+
SetLastError(0xdeadbeef);
result = GetOpenFileNameW((LPOPENFILENAMEW) &ofn);
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
@@ -97,19 +115,6 @@ static void test_DialogCancel(void)
CommDlgExtendedError());
}
- PrintDlgA(NULL);
- ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",
- CDERR_INITIALIZATION, CommDlgExtendedError());
-
- result = GetSaveFileNameA(&ofn);
- ok(0 == result, "expected %d, got %d\n", 0, result);
- ok(0 == CommDlgExtendedError(), "expected %d, got %d\n", 0,
- CommDlgExtendedError());
-
- PrintDlgA(NULL);
- ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",
- CDERR_INITIALIZATION, CommDlgExtendedError());
-
SetLastError(0xdeadbeef);
result = GetSaveFileNameW((LPOPENFILENAMEW) &ofn);
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
More information about the wine-cvs
mailing list