=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: kernel32/tests: Don' t test functions directly when reporting GetLastError().

Alexandre Julliard julliard at winehq.org
Fri Aug 2 14:26:30 CDT 2019


Module: wine
Branch: master
Commit: 19d96f99c641731a7e6b576b53f91c8937d012dc
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=19d96f99c641731a7e6b576b53f91c8937d012dc

Author: André Hentschel <nerv at dawncrow.de>
Date:   Thu Aug  1 21:12:30 2019 +0200

kernel32/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/kernel32/tests/actctx.c | 40 ++++++++++++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 4dede37..2b8c3d7 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -3271,13 +3271,25 @@ static void clean_sxs_info(sxs_info *info)
     if (info->handle_context)
         ReleaseActCtx(info->handle_context);
     if (*info->path_dll)
-        ok(DeleteFileA(info->path_dll), "DeleteFileA failed for %s: %d\n", info->path_dll, GetLastError());
+    {
+        BOOL ret = DeleteFileA(info->path_dll);
+        ok(ret, "DeleteFileA failed for %s: %d\n", info->path_dll, GetLastError());
+    }
     if (*info->path_manifest_exe)
-        ok(DeleteFileA(info->path_manifest_exe), "DeleteFileA failed for %s: %d\n", info->path_manifest_exe, GetLastError());
+    {
+        BOOL ret = DeleteFileA(info->path_manifest_exe);
+        ok(ret, "DeleteFileA failed for %s: %d\n", info->path_manifest_exe, GetLastError());
+    }
     if (*info->path_manifest_dll)
-        ok(DeleteFileA(info->path_manifest_dll), "DeleteFileA failed for %s: %d\n", info->path_manifest_dll, GetLastError());
+    {
+        BOOL ret = DeleteFileA(info->path_manifest_dll);
+        ok(ret, "DeleteFileA failed for %s: %d\n", info->path_manifest_dll, GetLastError());
+    }
     if (*info->path_tmp)
-        ok(RemoveDirectoryA(info->path_tmp), "RemoveDirectoryA failed for %s: %d\n", info->path_tmp, GetLastError());
+    {
+        BOOL ret = RemoveDirectoryA(info->path_tmp);
+        ok(ret, "RemoveDirectoryA failed for %s: %d\n", info->path_tmp, GetLastError());
+    }
 }
 
 static void get_application_directory(char *buffer, int buffer_size)
@@ -3348,7 +3360,10 @@ cleanup:
     if (dll.module)
         FreeLibrary(dll.module);
     if (*path_dll_local)
-        ok(DeleteFileA(path_dll_local), "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    {
+        BOOL success = DeleteFileA(path_dll_local);
+        ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    }
     clean_sxs_info(&dll);
 }
 
@@ -3385,7 +3400,10 @@ cleanup:
     if (dll.module)
         FreeLibrary(dll.module);
     if (*path_dll_local)
-        ok(DeleteFileA(path_dll_local), "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    {
+        BOOL success = DeleteFileA(path_dll_local);
+        ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    }
     clean_sxs_info(&dll);
 }
 
@@ -3423,7 +3441,10 @@ cleanup:
     if (dll.module)
         FreeLibrary(dll.module);
     if (*path_dll_local)
-        ok(DeleteFileA(path_dll_local), "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    {
+        success = DeleteFileA(path_dll_local);
+        ok(success, "DeleteFileA failed for %s: %d\n", path_dll_local, GetLastError());
+    }
     clean_sxs_info(&dll);
 }
 
@@ -3486,7 +3507,10 @@ cleanup:
     if (module_msvcr)
         FreeLibrary(module_msvcr);
     if (*path_manifest)
-        ok(DeleteFileA(path_manifest), "DeleteFileA failed for %s: %d\n", path_manifest, GetLastError());
+    {
+        success = DeleteFileA(path_manifest);
+        ok(success, "DeleteFileA failed for %s: %d\n", path_manifest, GetLastError());
+    }
 }
 
 static void run_sxs_test(int run)




More information about the wine-cvs mailing list