Nikolay Sivov : gdi32/tests: Run memory resource font test in a child process.

Alexandre Julliard julliard at winehq.org
Wed Nov 21 16:08:07 CST 2018


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Nov 21 15:54:00 2018 +0300

gdi32/tests: Run memory resource font test in a child process.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/tests/font.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 4f10e2f..dfb2f8e 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -20,6 +20,7 @@
  */
 
 #include <stdarg.h>
+#include <stdio.h>
 #include <assert.h>
 
 #include "windef.h"
@@ -6859,8 +6860,25 @@ static void test_long_names(void)
 
 START_TEST(font)
 {
+    static const char *test_names[] =
+    {
+        "AddFontMemResource",
+    };
+    char path_name[MAX_PATH];
+    STARTUPINFOA startup;
+    char **argv;
+    int argc, i;
+
     init();
 
+    argc = winetest_get_mainargs(&argv);
+    if (argc >= 3)
+    {
+        if (!strcmp(argv[2], "AddFontMemResource"))
+            test_AddFontMemResource();
+        return;
+    }
+
     test_stock_fonts();
     test_logfont();
     test_bitmap_font();
@@ -6879,7 +6897,6 @@ START_TEST(font)
     test_nonexistent_font();
     test_orientation();
     test_height_selection();
-    test_AddFontMemResource();
     test_EnumFonts();
     test_EnumFonts_subst();
 
@@ -6928,4 +6945,19 @@ START_TEST(font)
      */
     test_vertical_font();
     test_CreateScalableFontResource();
+
+    winetest_get_mainargs( &argv );
+    for (i = 0; i < ARRAY_SIZE(test_names); ++i)
+    {
+        PROCESS_INFORMATION info;
+
+        memset(&startup, 0, sizeof(startup));
+        startup.cb = sizeof(startup);
+        sprintf(path_name, "%s font %s", argv[0], test_names[i]);
+        ok(CreateProcessA(NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info),
+            "CreateProcess failed.\n");
+        winetest_wait_child_process(info.hProcess);
+        CloseHandle(info.hProcess);
+        CloseHandle(info.hThread);
+    }
 }




More information about the wine-cvs mailing list