Paul Vriens : kernel32/tests: Fix some test failures on Win9x/WinMe.

Alexandre Julliard julliard at winehq.org
Wed Oct 14 09:02:02 CDT 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Oct 14 13:34:06 2009 +0200

kernel32/tests: Fix some test failures on Win9x/WinMe.

---

 dlls/kernel32/tests/console.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index c3fa57c..33eab26 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -270,6 +270,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
     const int	mylen = strlen(mytest);
     const int	mylen2 = strchr(mytest, '\n') - mytest;
     int			p;
+    WORD                attr;
 
     ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, (mode | ENABLE_PROCESSED_OUTPUT) & ~ENABLE_WRAP_AT_EOL_OUTPUT),
        "clearing wrap at EOL & setting processed output\n");
@@ -284,6 +285,15 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize)
     {
         okCHAR(hCon, c, mytest[c.X - sbSize.X + 5], TEST_ATTRIB);
     }
+
+    ReadConsoleOutputAttribute(hCon, &attr, 1, c, &len);
+    /* Win9x and WinMe change the attribs for '\n' up to 'f' */
+    if (attr == TEST_ATTRIB)
+    {
+        win_skip("Win9x/WinMe don't respect ~ENABLE_WRAP_AT_EOL_OUTPUT\n");
+        return;
+    }
+
     okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
 
     c.X = 0; c.Y++;
@@ -381,6 +391,7 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
     const char*		mytest = "abcd\nf\tg";
     const int	mylen = strlen(mytest);
     int			p;
+    WORD                attr;
 
     ok(GetConsoleMode(hCon, &mode) && SetConsoleMode(hCon, mode | (ENABLE_WRAP_AT_EOL_OUTPUT|ENABLE_PROCESSED_OUTPUT)),
        "setting wrap at EOL & processed output\n");
@@ -396,7 +407,11 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
         okCHAR(hCon, c, mytest[p], TEST_ATTRIB);
     }
     c.X = sbSize.X - 9 + p;
-    okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
+    ReadConsoleOutputAttribute(hCon, &attr, 1, c, &len);
+    if (attr == TEST_ATTRIB)
+        win_skip("Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
+    else
+        okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
     c.X = 0; c.Y++;
     okCHAR(hCon, c, mytest[5], TEST_ATTRIB);
     for (c.X = 1; c.X < 8; c.X++)
@@ -419,7 +434,11 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize)
     c.X = 0; c.Y++;
     okCHAR(hCon, c, mytest[3], TEST_ATTRIB);
     c.X++;
-    okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
+    ReadConsoleOutputAttribute(hCon, &attr, 1, c, &len);
+    if (attr == TEST_ATTRIB)
+        win_skip("Win9x/WinMe changes attribs for '\\n' up to 'f'\n");
+    else
+        okCHAR(hCon, c, ' ', DEFAULT_ATTRIB);
 
     c.X = 0; c.Y++;
     okCHAR(hCon, c, mytest[5], TEST_ATTRIB);




More information about the wine-cvs mailing list