mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 05:52:56 +00:00
[WIN32NT_APITEST] Update NtUserSetTimer API tests (#7278)
JIRA issue: [CORE-9141](https://jira.reactos.org/browse/CORE-9141)
This commit is contained in:
parent
34586814ab
commit
f1def09c08
1 changed files with 4 additions and 9 deletions
|
@ -9,7 +9,8 @@
|
||||||
#include "../win32nt.h"
|
#include "../win32nt.h"
|
||||||
|
|
||||||
#define SLEEP_TIME 500
|
#define SLEEP_TIME 500
|
||||||
#define TIME_TOLERANCE 0.5
|
#define MIN_MESSAGES_TIME 1
|
||||||
|
#define MAX_MESSAGES_TIME 1000
|
||||||
|
|
||||||
#define TEST1_COUNT 20
|
#define TEST1_COUNT 20
|
||||||
#define TEST1_INTERVAL 10
|
#define TEST1_INTERVAL 10
|
||||||
|
@ -71,9 +72,6 @@ static BOOL test1(void)
|
||||||
ULONGLONG startTime;
|
ULONGLONG startTime;
|
||||||
MSG msg = { NULL };
|
MSG msg = { NULL };
|
||||||
|
|
||||||
int minMessages = ((float)SLEEP_TIME / (float)TEST1_INTERVAL) * (1 - TIME_TOLERANCE);
|
|
||||||
int maxMessages = ((float)SLEEP_TIME / (float)TEST1_INTERVAL) * (1 + TIME_TOLERANCE);
|
|
||||||
|
|
||||||
ZeroMemory(timerId1, sizeof(timerId1));
|
ZeroMemory(timerId1, sizeof(timerId1));
|
||||||
|
|
||||||
for (i = 0; i < TEST1_COUNT; i++)
|
for (i = 0; i < TEST1_COUNT; i++)
|
||||||
|
@ -96,7 +94,7 @@ static BOOL test1(void)
|
||||||
|
|
||||||
for (i = 0; i < TEST1_COUNT; i++)
|
for (i = 0; i < TEST1_COUNT; i++)
|
||||||
{
|
{
|
||||||
if ((timerId1[i].counter < minMessages) || (timerId1[i].counter > maxMessages))
|
if ((timerId1[i].counter < MIN_MESSAGES_TIME) || (timerId1[i].counter > MAX_MESSAGES_TIME))
|
||||||
countErrors++;
|
countErrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,9 +160,6 @@ static BOOL testW1(HWND hwnd)
|
||||||
if (hwnd == NULL)
|
if (hwnd == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int minMessages = ((float)SLEEP_TIME / (float)TESTW1_INTERVAL) * (1 - TIME_TOLERANCE);
|
|
||||||
int maxMessages = ((float)SLEEP_TIME / (float)TESTW1_INTERVAL) * (1 + TIME_TOLERANCE);
|
|
||||||
|
|
||||||
ZeroMemory(timerIdW1, sizeof(timerIdW1));
|
ZeroMemory(timerIdW1, sizeof(timerIdW1));
|
||||||
|
|
||||||
for (i = 0; i < TESTW1_COUNT; i++)
|
for (i = 0; i < TESTW1_COUNT; i++)
|
||||||
|
@ -187,7 +182,7 @@ static BOOL testW1(HWND hwnd)
|
||||||
|
|
||||||
for (i = 0; i < TESTW1_COUNT; i++)
|
for (i = 0; i < TESTW1_COUNT; i++)
|
||||||
{
|
{
|
||||||
if ((timerIdW1[i].counter < minMessages) || (timerIdW1[i].counter > maxMessages))
|
if ((timerIdW1[i].counter < MIN_MESSAGES_TIME) || (timerIdW1[i].counter > MAX_MESSAGES_TIME))
|
||||||
countErrors++;
|
countErrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue