Francois Gouget : winetest: Avoid duplicating the extract_test_proc() cleanup code.

Alexandre Julliard julliard at winehq.org
Wed Mar 10 14:58:47 CST 2021


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 10 18:15:58 2021 +0100

winetest: Avoid duplicating the extract_test_proc() cleanup code.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/winetest/main.c | 54 ++++++++++++++++++++----------------------------
 1 file changed, 22 insertions(+), 32 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 1731850bfdb..408e1b3c706 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -890,6 +890,7 @@ extract_test_proc (HMODULE hModule, LPCSTR lpszType, LPSTR lpszName, LONG_PTR lP
     DWORD err;
     HANDLE actctx;
     ULONG_PTR cookie;
+    BOOL run;
 
     if (aborting) return TRUE;
 
@@ -941,50 +942,39 @@ extract_test_proc (HMODULE hModule, LPCSTR lpszType, LPSTR lpszName, LONG_PTR lP
         else dll = 0;
     }
 
+    run = TRUE;
     if (!dll)
     {
         xprintf ("    %s=dll is missing\n", dllname);
-        if (actctx != INVALID_HANDLE_VALUE)
-        {
-            pDeactivateActCtx(0, cookie);
-            pReleaseActCtx(actctx);
-        }
-        return TRUE;
+        run = FALSE;
     }
-    if(is_stub_dll(dllname))
+    else
     {
-        FreeLibrary(dll);
-        xprintf ("    %s=dll is a stub\n", dllname);
-        if (actctx != INVALID_HANDLE_VALUE)
+        if (is_stub_dll(dllname))
         {
-            pDeactivateActCtx(0, cookie);
-            pReleaseActCtx(actctx);
+            xprintf ("    %s=dll is a stub\n", dllname);
+            run = FALSE;
         }
-        return TRUE;
-    }
-    if (is_native_dll(dll))
-    {
-        FreeLibrary(dll);
-        xprintf ("    %s=load error Configured as native\n", dllname);
-        nr_native_dlls++;
-        if (actctx != INVALID_HANDLE_VALUE)
+        else if (is_native_dll(dll))
         {
-            pDeactivateActCtx(0, cookie);
-            pReleaseActCtx(actctx);
+            xprintf ("    %s=load error Configured as native\n", dllname);
+            nr_native_dlls++;
+            run = FALSE;
         }
-        return TRUE;
+        FreeLibrary(dll);
     }
-    FreeLibrary(dll);
 
-    if (!(err = get_subtests( tempdir, &wine_tests[nr_of_files], lpszName )))
+    if (run)
     {
-        xprintf ("    %s=%s\n", dllname, get_file_version(filename));
-        nr_of_tests += wine_tests[nr_of_files].subtest_count;
-        nr_of_files++;
-    }
-    else
-    {
-        xprintf ("    %s=load error %u\n", dllname, err);
+        err = get_subtests( tempdir, &wine_tests[nr_of_files], lpszName );
+        if (!err)
+        {
+            xprintf ("    %s=%s\n", dllname, get_file_version(filename));
+            nr_of_tests += wine_tests[nr_of_files].subtest_count;
+            nr_of_files++;
+        }
+        else
+            xprintf ("    %s=load error %u\n", dllname, err);
     }
 
     if (actctx != INVALID_HANDLE_VALUE)




More information about the wine-cvs mailing list