https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f1def09c08c70a89905dc5...
commit f1def09c08c70a89905dc518c1d51ed2533d2b53 Author: Tomáš Veselý turican0@gmail.com AuthorDate: Sat Aug 31 01:26:15 2024 +0200 Commit: GitHub noreply@github.com CommitDate: Fri Aug 30 18:26:15 2024 -0500
[WIN32NT_APITEST] Update NtUserSetTimer API tests (#7278)
JIRA issue: [CORE-9141](https://jira.reactos.org/browse/CORE-9141) --- modules/rostests/apitests/win32nt/ntuser/NtUserSetTimer.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/modules/rostests/apitests/win32nt/ntuser/NtUserSetTimer.c b/modules/rostests/apitests/win32nt/ntuser/NtUserSetTimer.c index ccdc6da4602..797dc292659 100644 --- a/modules/rostests/apitests/win32nt/ntuser/NtUserSetTimer.c +++ b/modules/rostests/apitests/win32nt/ntuser/NtUserSetTimer.c @@ -9,7 +9,8 @@ #include "../win32nt.h"
#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_INTERVAL 10 @@ -71,9 +72,6 @@ static BOOL test1(void) ULONGLONG startTime; 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));
for (i = 0; i < TEST1_COUNT; i++) @@ -96,7 +94,7 @@ static BOOL test1(void)
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++; }
@@ -162,9 +160,6 @@ static BOOL testW1(HWND hwnd) if (hwnd == NULL) 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));
for (i = 0; i < TESTW1_COUNT; i++) @@ -187,7 +182,7 @@ static BOOL testW1(HWND hwnd)
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++; }