Jeff Smith : kernel32/tests: Allow for differing fpu_cw returned on Windows XP.

Alexandre Julliard julliard at winehq.org
Fri Dec 6 16:06:39 CST 2019


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

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Thu Dec  5 23:47:42 2019 -0600

kernel32/tests: Allow for differing fpu_cw returned on Windows XP.

Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/thread.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index 9a8ad9151c..8c27024cf2 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -1745,14 +1745,16 @@ static unsigned int get_thread_fpu_cw( unsigned long *fpu_cw )
 
 static void test_thread_fpu_cw(void)
 {
-    static const struct { unsigned int cw; unsigned long fpu_cw; } expected_cw[6] =
+    static const struct {
+        unsigned int cw; unsigned long fpu_cw; unsigned long fpu_cw_broken;
+    } expected_cw[6] =
     {
 #ifdef __i386__
         { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
         { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
-        { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ) },
+        { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) },
         { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) },
-        { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ) },
+        { _EM_INEXACT | _RC_CHOP | _PC_24, MAKELONG( 0xc60, 0x7000 ), MAKELONG( 0xc60, 0x1f80 ) },
         { _MCW_EM | _PC_53, MAKELONG( 0x27f, 0x1f80 ) }
 #elif defined(__x86_64__)
         { _MCW_EM | _PC_64, MAKELONG( 0x27f, 0x1f80 ) },
@@ -1788,7 +1790,9 @@ static void test_thread_fpu_cw(void)
     cw = _control87( 0, 0 );
     fpu_cw = get_fpu_cw();
     ok(cw == expected_cw[2].cw, "expected %#x got %#x\n", expected_cw[2].cw, cw);
-    ok(fpu_cw == expected_cw[2].fpu_cw, "expected %#lx got %#lx\n", expected_cw[2].fpu_cw, fpu_cw);
+    ok(fpu_cw == expected_cw[2].fpu_cw ||
+            broken(expected_cw[2].fpu_cw_broken && fpu_cw == expected_cw[2].fpu_cw_broken),
+        "expected %#lx got %#lx\n", expected_cw[2].fpu_cw, fpu_cw);
 
     cw = get_thread_fpu_cw( &fpu_cw );
     ok(cw == expected_cw[3].cw, "expected %#x got %#x\n", expected_cw[3].cw, cw);
@@ -1797,7 +1801,9 @@ static void test_thread_fpu_cw(void)
     cw = _control87( 0, 0 );
     fpu_cw = get_fpu_cw();
     ok(cw == expected_cw[4].cw, "expected %#x got %#x\n", expected_cw[4].cw, cw);
-    ok(fpu_cw == expected_cw[4].fpu_cw, "expected %#lx got %#lx\n", expected_cw[4].fpu_cw, fpu_cw);
+    ok(fpu_cw == expected_cw[4].fpu_cw ||
+            broken(expected_cw[4].fpu_cw_broken && fpu_cw == expected_cw[4].fpu_cw_broken),
+        "expected %#lx got %#lx\n", expected_cw[4].fpu_cw, fpu_cw);
 
     _control87( initial_cw, _MCW_EM | _MCW_RC | _MCW_PC );
     cw = _control87( 0, 0 );




More information about the wine-cvs mailing list