=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: shell32/tests: Don' t test functions directly when reporting GetLastError().
Alexandre Julliard
julliard at winehq.org
Tue Jan 2 13:19:01 CST 2018
Module: wine
Branch: master
Commit: 063fd7a665c71145dcefdcfe99992d7f8ca0a119
URL: https://source.winehq.org/git/wine.git/?a=commit;h=063fd7a665c71145dcefdcfe99992d7f8ca0a119
Author: André Hentschel <nerv at dawncrow.de>
Date: Sat Dec 30 19:57:54 2017 +0100
shell32/tests: Don't test functions directly when reporting GetLastError().
Signed-off-by: André Hentschel <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/tests/shelldispatch.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index ce3b1a3..64a695d 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -387,6 +387,7 @@ static void test_items(void)
HANDLE file;
BSTR bstr;
char cstr[64];
+ BOOL ret;
int i;
r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, &IID_IShellDispatch, (void**)&sd);
@@ -397,7 +398,8 @@ static void test_items(void)
GetTempPathW(MAX_PATH, path);
GetCurrentDirectoryW(MAX_PATH, orig_dir);
SetCurrentDirectoryW(path);
- ok(CreateDirectoryW(winetestW, NULL), "CreateDirectory failed: %08x\n", GetLastError());
+ ret = CreateDirectoryW(winetestW, NULL);
+ ok(ret, "CreateDirectory failed: %08x\n", GetLastError());
GetFullPathNameW(winetestW, MAX_PATH, path, NULL);
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = SysAllocString(path);
@@ -673,7 +675,8 @@ static void test_items(void)
VariantClear(&str_index2);
/* delete the file in the subdirectory */
- ok(DeleteFileA(cstr), "file_defs[%d]: DeleteFile failed: %08x\n", i, GetLastError());
+ ret = DeleteFileA(cstr);
+ ok(ret, "file_defs[%d]: DeleteFile failed: %08x\n", i, GetLastError());
/* test that getting an item object via a relative path fails */
strcpy(cstr, file_defs[i].name);
@@ -690,11 +693,13 @@ static void test_items(void)
VariantClear(&str_index2);
/* remove the directory */
- ok(RemoveDirectoryA(file_defs[i].name), "file_defs[%d]: RemoveDirectory failed: %08x\n", i, GetLastError());
+ ret = RemoveDirectoryA(file_defs[i].name);
+ ok(ret, "file_defs[%d]: RemoveDirectory failed: %08x\n", i, GetLastError());
}
else
{
- ok(DeleteFileA(file_defs[i].name), "file_defs[%d]: DeleteFile failed: %08x\n", i, GetLastError());
+ ret = DeleteFileA(file_defs[i].name);
+ ok(ret, "file_defs[%d]: DeleteFile failed: %08x\n", i, GetLastError());
}
/* test that the folder item is still accessible by integer index */
@@ -789,7 +794,8 @@ todo_wine
/* remove the temporary directory and restore the original working directory */
GetTempPathW(MAX_PATH, path);
SetCurrentDirectoryW(path);
- ok(RemoveDirectoryW(winetestW), "RemoveDirectory failed: %08x\n", GetLastError());
+ ret = RemoveDirectoryW(winetestW);
+ ok(ret, "RemoveDirectory failed: %08x\n", GetLastError());
SetCurrentDirectoryW(orig_dir);
/* test that everything stops working after the directory has been removed */
More information about the wine-cvs
mailing list