[PATCH 7/7] [Kernel32/tests]: added a dedicated env variable (WINETEST_DIRECTCONSOLE) so that bare consoles can be (partially) tested

Eric Pouech eric.pouech at orange.fr
Sat Dec 29 09:21:58 CST 2012




A+
---

 dlls/kernel32/tests/console.c |   58 ++++++++++++++++++++++++-----------------
 1 file changed, 34 insertions(+), 24 deletions(-)


diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index b1907d7..58858c8 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -2538,6 +2538,7 @@ START_TEST(console)
     char old_font[LF_FACESIZE];
     BOOL delete = FALSE;
     DWORD size;
+    BOOL full_console = getenv("WINETEST_DIRECTCONSOLE") == NULL;
 
     init_function_pointers();
 
@@ -2583,9 +2584,12 @@ START_TEST(console)
         console_key = NULL;
     }
 
-    /* Now detach and open a fresh console to play with */
-    FreeConsole();
-    ok(AllocConsole(), "Couldn't alloc console\n");
+    if (full_console)
+    {
+        /* Now detach and open a fresh console to play with */
+        FreeConsole();
+        ok(AllocConsole(), "Couldn't alloc console\n");
+    }
 
     /* Restore default console font if needed */
     if (console_key != NULL)
@@ -2608,18 +2612,21 @@ START_TEST(console)
     ok(ret, "Getting sb info\n");
     if (!ret) return;
 
-    /* Non interactive tests */
-    testCursor(hConOut, sbi.dwSize);
-    /* test parameters (FIXME: test functionality) */
-    testCursorInfo(hConOut);
-    /* will test wrapped (on/off) & processed (on/off) strings output */
-    testWrite(hConOut, sbi.dwSize);
-    /* will test line scrolling at the bottom of the screen */
-    /* testBottomScroll(); */
-    /* will test all the scrolling operations */
-    testScroll(hConOut, sbi.dwSize);
-    /* will test sb creation / modification / codepage handling */
-    testScreenBuffer(hConOut);
+    if (full_console)
+    {
+        /* Non interactive tests */
+        testCursor(hConOut, sbi.dwSize);
+        /* test parameters (FIXME: test functionality) */
+        testCursorInfo(hConOut);
+        /* will test wrapped (on/off) & processed (on/off) strings output */
+        testWrite(hConOut, sbi.dwSize);
+        /* will test line scrolling at the bottom of the screen */
+        /* testBottomScroll(); */
+        /* will test all the scrolling operations */
+        testScroll(hConOut, sbi.dwSize);
+        /* will test sb creation / modification / codepage handling */
+        testScreenBuffer(hConOut);
+    }
     testCtrlHandler();
     /* still to be done: access rights & access on objects */
 
@@ -2637,13 +2644,16 @@ START_TEST(console)
     test_GetNumberOfConsoleInputEvents(hConIn);
     test_WriteConsoleInputA(hConIn);
     test_WriteConsoleInputW(hConIn);
-    test_WriteConsoleOutputCharacterA(hConOut);
-    test_WriteConsoleOutputCharacterW(hConOut);
-    test_WriteConsoleOutputAttribute(hConOut);
-    test_FillConsoleOutputCharacterA(hConOut);
-    test_FillConsoleOutputCharacterW(hConOut);
-    test_FillConsoleOutputAttribute(hConOut);
-    test_ReadConsoleOutputCharacterA(hConOut);
-    test_ReadConsoleOutputCharacterW(hConOut);
-    test_ReadConsoleOutputAttribute(hConOut);
+    if (full_console)
+    {
+        test_WriteConsoleOutputCharacterA(hConOut);
+        test_WriteConsoleOutputCharacterW(hConOut);
+        test_WriteConsoleOutputAttribute(hConOut);
+        test_FillConsoleOutputCharacterA(hConOut);
+        test_FillConsoleOutputCharacterW(hConOut);
+        test_FillConsoleOutputAttribute(hConOut);
+        test_ReadConsoleOutputCharacterA(hConOut);
+        test_ReadConsoleOutputCharacterW(hConOut);
+        test_ReadConsoleOutputAttribute(hConOut);
+    }
 }




More information about the wine-patches mailing list