André Hentschel : comdlg32/tests: Don' t test function directly when reporting GetLastError().
Alexandre Julliard
julliard at winehq.org
Thu Dec 30 10:49:56 CST 2010
Module: wine
Branch: master
Commit: a608fe9328acdb484d38f185064f8dd086e534c2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a608fe9328acdb484d38f185064f8dd086e534c2
Author: André Hentschel <nerv at dawncrow.de>
Date: Wed Dec 29 19:41:39 2010 +0100
comdlg32/tests: Don't test function directly when reporting GetLastError().
---
dlls/comdlg32/tests/filedlg.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c
index 24c663e..3b4a92f 100644
--- a/dlls/comdlg32/tests/filedlg.c
+++ b/dlls/comdlg32/tests/filedlg.c
@@ -647,8 +647,10 @@ static void test_ok(void)
char curdir[MAX_PATH];
int i;
DWORD ret;
+ BOOL cdret;
- ok(GetCurrentDirectoryA(sizeof(curdir), curdir) != 0, "Failed to get current dir err %d\n", GetLastError());
+ cdret = GetCurrentDirectoryA(sizeof(curdir), curdir);
+ ok(cdret, "Failed to get current dir err %d\n", GetLastError());
if (!GetTempFileNameA(".", "txt", 0, tmpfilename)) {
skip("Failed to create a temporary file name\n");
return;
@@ -671,7 +673,8 @@ static void test_ok(void)
ok(ret == ok_testcases[i].expclose, "testid %d: GetOpenFileName returned %#x\n", i, ret);
ret = CommDlgExtendedError();
ok(!ret, "CommDlgExtendedError returned %#x\n", ret);
- ok(SetCurrentDirectoryA(curdir), "Failed to restore current dir err %d\n", GetLastError());
+ cdret = SetCurrentDirectoryA(curdir);
+ ok(cdret, "Failed to restore current dir err %d\n", GetLastError());
}
ret = DeleteFileA( tmpfilename);
ok( ret, "Failed to delete temporary file %s err %d\n", tmpfilename, GetLastError());
@@ -1057,8 +1060,10 @@ static void test_extension(void)
char *filename_ptr;
const char *test_file_name = "deadbeef";
DWORD ret;
+ BOOL cdret;
- ok(GetCurrentDirectoryA(sizeof(curdir), curdir) != 0, "Failed to get current dir err %d\n", GetLastError());
+ cdret = GetCurrentDirectoryA(sizeof(curdir), curdir);
+ ok(cdret, "Failed to get current dir err %d\n", GetLastError());
/* Ignore .* extension */
ofn.lStructSize = sizeof(ofn);
More information about the wine-cvs
mailing list