Zebediah Figura : ntdll/tests: Fix a failure in test_thread_context() under Wine.

Alexandre Julliard julliard at winehq.org
Thu Jun 24 16:16:45 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Jun 24 11:14:35 2021 -0500

ntdll/tests: Fix a failure in test_thread_context() under Wine.

Follow-up to 94ee27097228ac37f1576565c9f93f6186ff66a3.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/exception.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 1a63a717d21..24f905e86dd 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -4002,7 +4002,6 @@ static void test_thread_context(void)
         XMM_SAVE_AREA32 FltSave;
         WORD SegCs, SegDs, SegEs, SegFs, SegGs, SegSs;
     } expect;
-    XMM_SAVE_AREA32 broken_fltsave;
     NTSTATUS (*func_ptr)( void *arg1, void *arg2, struct expected *res, void *func ) = code_mem;
 
     static const BYTE call_func[] =
@@ -4164,12 +4163,12 @@ static void test_thread_context(void)
     COMPARE( SegGs );
     COMPARE( SegSs );
 
-    broken_fltsave = context.FltSave;
-    memset( &broken_fltsave.ErrorOpcode, 0xcc, 0x12 );
+    /* AMD CPUs don't save the opcode or data pointer if no exception is
+     * pending; see the AMD64 Architecture Programmer's Manual Volume 5 s.v.
+     * FXSAVE */
+    memcpy( &expect.FltSave, &context.FltSave, 0x12 );
 
-    ok( !memcmp( &context.FltSave, &expect.FltSave, offsetof( XMM_SAVE_AREA32, XmmRegisters )) ||
-        broken( !memcmp( &broken_fltsave, &expect.FltSave, offsetof( XMM_SAVE_AREA32, XmmRegisters )) ) /* w2008, w8 */,
-        "wrong FltSave\n" );
+    ok( !memcmp( &context.FltSave, &expect.FltSave, offsetof( XMM_SAVE_AREA32, ErrorOffset )), "wrong FltSave\n" );
     for (i = 6; i < 16; i++)
         ok( !memcmp( &context.Xmm0 + i, &expect.FltSave.XmmRegisters[i], sizeof(context.Xmm0) ),
             "wrong xmm%u\n", i );




More information about the wine-cvs mailing list