Fix timer tests to pass on windows 98.

This commit is contained in:
Robert Reif 2005-02-18 12:51:54 +00:00 committed by Alexandre Julliard
parent 2b30370796
commit e3566d8260
1 changed files with 13 additions and 10 deletions

View File

@ -33,23 +33,26 @@
#include "winmm_test.h" #include "winmm_test.h"
TIMECAPS tc; static TIMECAPS tc;
void test_timeGetDevCaps() static void test_timeGetDevCaps()
{ {
MMRESULT rc; MMRESULT rc;
rc = timeGetDevCaps(&tc, 0); rc = timeGetDevCaps(&tc, 0);
ok(rc == TIMERR_NOCANDO, "timeGetDevCaps() returned %s, " ok(rc == TIMERR_NOCANDO || rc == MMSYSERR_INVALPARAM,
"should have returned TIMERR_NOCANDO\n", mmsys_error(rc)); "timeGetDevCaps() returned %s, should have returned TIMERR_NOCANDO "
"or MMSYSERR_INVALPARAM\n", mmsys_error(rc));
rc = timeGetDevCaps(0, sizeof(tc)); rc = timeGetDevCaps(0, sizeof(tc));
ok(rc == TIMERR_NOCANDO, "timeGetDevCaps() returned %s, " ok(rc == TIMERR_NOCANDO || rc == TIMERR_STRUCT,
"should have returned TIMERR_NOCANDO\n", mmsys_error(rc)); "timeGetDevCaps() returned %s, should have returned TIMERR_NOCANDO "
"or TIMERR_STRUCT\n", mmsys_error(rc));
rc = timeGetDevCaps(0, 0); rc = timeGetDevCaps(0, 0);
ok(rc == TIMERR_NOCANDO, "timeGetDevCaps() returned %s, " ok(rc == TIMERR_NOCANDO || rc == MMSYSERR_INVALPARAM,
"should have returned TIMERR_NOCANDO\n", mmsys_error(rc)); "timeGetDevCaps() returned %s, should have returned TIMERR_NOCANDO "
"or MMSYSERR_INVALPARAM\n", mmsys_error(rc));
rc = timeGetDevCaps(&tc, sizeof(tc)); rc = timeGetDevCaps(&tc, sizeof(tc));
ok(rc == TIMERR_NOERROR, "timeGetDevCaps() returned %s, " ok(rc == TIMERR_NOERROR, "timeGetDevCaps() returned %s, "
@ -65,13 +68,13 @@ void test_timeGetDevCaps()
static DWORD count = 0; static DWORD count = 0;
static DWORD times[NUM_SAMPLES]; static DWORD times[NUM_SAMPLES];
void CALLBACK testTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) static void CALLBACK testTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
{ {
if (count < NUM_SAMPLES) if (count < NUM_SAMPLES)
times[count++] = timeGetTime(); times[count++] = timeGetTime();
} }
void test_timer(UINT period, UINT resolution) static void test_timer(UINT period, UINT resolution)
{ {
MMRESULT rc; MMRESULT rc;
UINT i, id, delta; UINT i, id, delta;