ntdll-User_Shared_Data: Fix test failures on WinXP.

This commit is contained in:
Sebastian Lackner 2017-05-14 00:48:30 +02:00
parent 8748402001
commit 5d38a0fed0

View File

@ -1,14 +1,14 @@
From 3f4763cc335ea4d8293862677fabe0f8218c5542 Mon Sep 17 00:00:00 2001
From 6a1a8685b7ee9fa485a796963d9b2a3430067b14 Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Tue, 2 May 2017 21:19:03 -0500
Subject: ntdll/tests: Test updating TickCount in user_shared_data.
---
dlls/ntdll/tests/time.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
dlls/ntdll/tests/time.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/dlls/ntdll/tests/time.c b/dlls/ntdll/tests/time.c
index b684bc1980d..0c8300a3428 100644
index b684bc1980d..f90ac6ff91c 100644
--- a/dlls/ntdll/tests/time.c
+++ b/dlls/ntdll/tests/time.c
@@ -18,7 +18,9 @@
@ -29,7 +29,7 @@ index b684bc1980d..0c8300a3428 100644
static const int MonthLengths[2][12] =
{
@@ -115,15 +118,34 @@ static void test_NtQueryPerformanceCounter(void)
@@ -115,15 +118,40 @@ static void test_NtQueryPerformanceCounter(void)
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
}
@ -40,10 +40,16 @@ index b684bc1980d..0c8300a3428 100644
+ LONG diff;
+ int i;
+
+ if (!pNtGetTickCount)
+ {
+ win_skip("NtGetTickCount is not available\n");
+ return;
+ }
+
+ for (i = 0; i < 5; ++i)
+ {
+ diff = (user_shared_data->u.TickCountQuad * user_shared_data->TickCountMultiplier) >> 24;
+ diff = NtGetTickCount() - diff;
+ diff = pNtGetTickCount() - diff;
+ ok(diff < 32, "NtGetTickCount - TickCountQuad too high, expected < 32 got %d\n", diff);
+ Sleep(50);
+ }