Commit 063fd7a6 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

shell32/tests: Don't test functions directly when reporting GetLastError().

parent 5200f347
...@@ -387,6 +387,7 @@ static void test_items(void) ...@@ -387,6 +387,7 @@ static void test_items(void)
HANDLE file; HANDLE file;
BSTR bstr; BSTR bstr;
char cstr[64]; char cstr[64];
BOOL ret;
int i; int i;
r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, &IID_IShellDispatch, (void**)&sd); r = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, &IID_IShellDispatch, (void**)&sd);
...@@ -397,7 +398,8 @@ static void test_items(void) ...@@ -397,7 +398,8 @@ static void test_items(void)
GetTempPathW(MAX_PATH, path); GetTempPathW(MAX_PATH, path);
GetCurrentDirectoryW(MAX_PATH, orig_dir); GetCurrentDirectoryW(MAX_PATH, orig_dir);
SetCurrentDirectoryW(path); 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); GetFullPathNameW(winetestW, MAX_PATH, path, NULL);
V_VT(&var) = VT_BSTR; V_VT(&var) = VT_BSTR;
V_BSTR(&var) = SysAllocString(path); V_BSTR(&var) = SysAllocString(path);
...@@ -673,7 +675,8 @@ static void test_items(void) ...@@ -673,7 +675,8 @@ static void test_items(void)
VariantClear(&str_index2); VariantClear(&str_index2);
/* delete the file in the subdirectory */ /* 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 */ /* test that getting an item object via a relative path fails */
strcpy(cstr, file_defs[i].name); strcpy(cstr, file_defs[i].name);
...@@ -690,11 +693,13 @@ static void test_items(void) ...@@ -690,11 +693,13 @@ static void test_items(void)
VariantClear(&str_index2); VariantClear(&str_index2);
/* remove the directory */ /* 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 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 */ /* test that the folder item is still accessible by integer index */
...@@ -789,7 +794,8 @@ todo_wine ...@@ -789,7 +794,8 @@ todo_wine
/* remove the temporary directory and restore the original working directory */ /* remove the temporary directory and restore the original working directory */
GetTempPathW(MAX_PATH, path); GetTempPathW(MAX_PATH, path);
SetCurrentDirectoryW(path); SetCurrentDirectoryW(path);
ok(RemoveDirectoryW(winetestW), "RemoveDirectory failed: %08x\n", GetLastError()); ret = RemoveDirectoryW(winetestW);
ok(ret, "RemoveDirectory failed: %08x\n", GetLastError());
SetCurrentDirectoryW(orig_dir); SetCurrentDirectoryW(orig_dir);
/* test that everything stops working after the directory has been removed */ /* test that everything stops working after the directory has been removed */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment