Commit cb17000c authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winmm/tests: Enable compilation with long types.

parent c5398095
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = winmm.dll
IMPORTS = winmm ole32 user32 advapi32
......
......@@ -65,8 +65,8 @@ static void check_position(int device, HWAVEIN win, DWORD bytes,
ok(mmtime.wType == TIME_BYTES, "waveInGetPosition(%s): returned %s\n",
dev_name(device), wave_time_format(mmtime.wType));
returned = time_to_bytes(&mmtime, pwfx);
ok(returned == bytes, "waveInGetPosition(%s): returned %d bytes, "
"should be %d\n", dev_name(device), returned, bytes);
ok(returned == bytes, "waveInGetPosition(%s): returned %ld bytes, "
"should be %ld\n", dev_name(device), returned, bytes);
mmtime.wType = TIME_SAMPLES;
rc=waveInGetPosition(win, &mmtime, sizeof(mmtime));
......@@ -75,8 +75,8 @@ static void check_position(int device, HWAVEIN win, DWORD bytes,
ok(mmtime.wType == TIME_SAMPLES, "waveInGetPosition(%s): returned %s\n",
dev_name(device), wave_time_format(mmtime.wType));
returned = time_to_bytes(&mmtime, pwfx);
ok(returned == bytes, "waveInGetPosition(%s): returned %d samples, "
"should be %d\n", dev_name(device), bytes_to_samples(returned, pwfx),
ok(returned == bytes, "waveInGetPosition(%s): returned %ld samples, "
"should be %ld\n", dev_name(device), bytes_to_samples(returned, pwfx),
bytes_to_samples(bytes, pwfx));
mmtime.wType = TIME_MS;
......@@ -147,7 +147,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
(!(flags & WAVE_FORMAT_DIRECT) || (flags & WAVE_MAPPED)) &&
!(pcaps->dwFormats & format)) ||
(rc==MMSYSERR_INVALFLAG && (flags & WAVE_FORMAT_DIRECT)),
"waveInOpen(%s): format=%dx%2dx%d flags=%x(%s) rc=%s\n",
"waveInOpen(%s): format=%ldx%2dx%d flags=%lx(%s) rc=%s\n",
dev_name(device),pwfx->nSamplesPerSec,pwfx->wBitsPerSample,
pwfx->nChannels,flags,wave_open_flags(flags),wave_in_error(rc));
if ((rc==WAVERR_BADFORMAT || rc==MMSYSERR_NOTSUPPORTED) &&
......@@ -156,7 +156,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
"capabilities but opening it failed.\n");
if ((rc==WAVERR_BADFORMAT || rc==MMSYSERR_NOTSUPPORTED) &&
!(pcaps->dwFormats & format))
trace("waveInOpen(%s): format=%dx%2dx%d %s rc=%s failed but format "
trace("waveInOpen(%s): format=%ldx%2dx%d %s rc=%s failed but format "
"not supported so OK.\n",dev_name(device),pwfx->nSamplesPerSec,
pwfx->wBitsPerSample,pwfx->nChannels,
flags & WAVE_FORMAT_DIRECT ? "flags=WAVE_FORMAT_DIRECT" :
......@@ -171,7 +171,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
ok(pwfx->nChannels==nChannels &&
pwfx->wBitsPerSample==wBitsPerSample &&
pwfx->nSamplesPerSec==nSamplesPerSec,
"got the wrong format: %dx%2dx%d instead of %dx%2dx%d\n",
"got the wrong format: %ldx%2dx%d instead of %ldx%2dx%d\n",
pwfx->nSamplesPerSec, pwfx->wBitsPerSample,
pwfx->nChannels, nSamplesPerSec, wBitsPerSample, nChannels);
......@@ -207,7 +207,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
"not set\n",dev_name(device));
if (winetest_interactive && rc==MMSYSERR_NOERROR) {
trace("Recording for 1 second at %5dx%2dx%d %s %s\n",
trace("Recording for 1 second at %5ldx%2dx%d %s %s\n",
pwfx->nSamplesPerSec, pwfx->wBitsPerSample,pwfx->nChannels,
get_format_str(pwfx->wFormatTag),
flags & WAVE_FORMAT_DIRECT ? "WAVE_FORMAT_DIRECT" :
......@@ -227,7 +227,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
ok(res==WAIT_OBJECT_0,"WaitForSingleObject failed for header\n");
ok(frag.dwFlags&WHDR_DONE,"WHDR_DONE not set in frag.dwFlags\n");
ok(frag.dwBytesRecorded==pwfx->nAvgBytesPerSec,
"frag.dwBytesRecorded=%d, should=%d\n",
"frag.dwBytesRecorded=%ld, should=%ld\n",
frag.dwBytesRecorded,pwfx->nAvgBytesPerSec);
mmt.wType = TIME_BYTES;
......@@ -235,7 +235,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
ok(rc==MMSYSERR_NOERROR,"waveInGetPosition(%s): rc=%s\n",
dev_name(device),wave_in_error(rc));
ok(mmt.wType == TIME_BYTES, "doesn't support TIME_BYTES: %u\n", mmt.wType);
ok(mmt.u.cb == frag.dwBytesRecorded, "Got wrong position: %u\n", mmt.u.cb);
ok(mmt.u.cb == frag.dwBytesRecorded, "Got wrong position: %lu\n", mmt.u.cb);
/* stop playing on error */
if (res!=WAIT_OBJECT_0) {
......@@ -269,7 +269,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
rc==MMSYSERR_ALLOCATED ||
((rc==WAVERR_BADFORMAT || rc==MMSYSERR_NOTSUPPORTED) &&
!(pcaps->dwFormats & format)),
"waveOutOpen(%s) format=%dx%2dx%d flags=CALLBACK_EVENT rc=%s\n",
"waveOutOpen(%s) format=%ldx%2dx%d flags=CALLBACK_EVENT rc=%s\n",
dev_name(device),pwfx->nSamplesPerSec,pwfx->wBitsPerSample,
pwfx->nChannels,wave_out_error(rc));
if (rc==MMSYSERR_NOERROR)
......@@ -385,7 +385,7 @@ static void wave_in_test_device(UINT_PTR device)
ok(rc==MMSYSERR_NOERROR,"waveInMessage(%s): failed to get interface "
"name: rc=%s\n",dev_name(device),wave_in_error(rc));
ok(lstrlenW(nameW)+1==size/sizeof(WCHAR),
"got an incorrect size %d\n", size);
"got an incorrect size %ld\n", size);
if (rc==MMSYSERR_NOERROR) {
nameA = HeapAlloc(GetProcessHeap(), 0, size/sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, nameW, size/sizeof(WCHAR),
......@@ -400,7 +400,7 @@ static void wave_in_test_device(UINT_PTR device)
trace(" %s: \"%s\" (%s) %d.%d (%d:%d)\n",dev_name(device),capsA.szPname,
(nameA?nameA:"failed"),capsA.vDriverVersion >> 8,
capsA.vDriverVersion & 0xff,capsA.wMid,capsA.wPid);
trace(" channels=%d formats=%05x\n",
trace(" channels=%d formats=%05lx\n",
capsA.wChannels,capsA.dwFormats);
HeapFree(GetProcessHeap(), 0, nameA);
......@@ -666,7 +666,7 @@ static void wave_in_tests(void)
if(rc != MMSYSERR_NOTSUPPORTED)
ok((ndev == 0 && (preferred == -1 || broken(preferred != -1))) ||
preferred < ndev, "Got invalid preferred device: 0x%x\n", preferred);
preferred < ndev, "Got invalid preferred device: 0x%lx\n", preferred);
rc = waveInMessage((HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET,
(DWORD_PTR)-1 , 0);
......
......@@ -46,7 +46,7 @@ static void create_window(void)
window = CreateWindowExA(0, name, name, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, NULL, NULL);
ok(window != NULL, "Expected CreateWindowEx to work, error %d\n", GetLastError());
ok(window != NULL, "Expected CreateWindowEx to work, error %ld\n", GetLastError());
}
static void destroy_window(void)
......@@ -211,11 +211,11 @@ static void test_api(void)
ret = joyGetPosEx(joyid, &infoex.ex);
if (ret == JOYERR_NOERROR)
{
trace("X: %5d, Y: %5d, Z: %5d, POV: %5d\n",
trace("X: %5ld, Y: %5ld, Z: %5ld, POV: %5ld\n",
infoex.ex.dwXpos, infoex.ex.dwYpos, infoex.ex.dwZpos, infoex.ex.dwPOV);
trace("R: %5d, U: %5d, V: %5d\n",
trace("R: %5ld, U: %5ld, V: %5ld\n",
infoex.ex.dwRpos, infoex.ex.dwUpos, infoex.ex.dwVpos);
trace("BUTTONS: 0x%04X, BUTTON_COUNT: %2d, REMAINING: %d ms\n\n",
trace("BUTTONS: 0x%04lX, BUTTON_COUNT: %2ld, REMAINING: %ld ms\n\n",
infoex.ex.dwButtons, infoex.ex.dwButtonNumber, MAX_TIME - spent);
}
Sleep(500);
......
......@@ -119,14 +119,14 @@ static void test_timer(UINT period, UINT resolution)
if (i == 0)
{
if (winetest_debug > 1)
trace("time[%d] = %u\n", i, times[i]);
trace("time[%d] = %lu\n", i, times[i]);
}
else
{
delta = times[i] - times[i - 1];
if (winetest_debug > 1)
trace("time[%d] = %u delta = %d\n", i, times[i], delta);
trace("time[%d] = %lu delta = %d\n", i, times[i], delta);
sum += delta;
deviation += ((delta - period) * (delta - period));
......@@ -139,7 +139,7 @@ static void test_timer(UINT period, UINT resolution)
}
}
trace("min = %u, max = %u, average = %f, standard deviation = %f\n",
trace("min = %lu, max = %lu, average = %f, standard deviation = %f\n",
dwMin, dwMax, sum / (count - 1), sqrt(deviation / (count - 2)));
}
......@@ -167,7 +167,7 @@ static void CALLBACK priorityTimeProc(UINT uID, UINT uMsg, DWORD_PTR dwUser,
DWORD_PTR dw1, DWORD_PTR dw2)
{
priority = GetThreadPriority(GetCurrentThread());
ok(priority!=THREAD_PRIORITY_ERROR_RETURN, "GetThreadPriority() failed, GetLastError() = %u\n", GetLastError());
ok(priority!=THREAD_PRIORITY_ERROR_RETURN, "GetThreadPriority() failed, GetLastError() = %lu\n", GetLastError());
fired = TRUE;
}
......
......@@ -357,7 +357,7 @@ static const char * wave_header_flags(DWORD flags)
}
if (flags & ~WHDR_MASK) {
char temp[32];
sprintf(temp, "UNKNOWN(0x%08x)", flags & ~WHDR_MASK);
sprintf(temp, "UNKNOWN(0x%08lx)", flags & ~WHDR_MASK);
if (!first) strcat(msg, " ");
strcat(msg, temp);
}
......@@ -486,8 +486,8 @@ static void check_position(int device, HWAVEOUT wout, DWORD bytes,
ok(mmtime.wType == TIME_BYTES, "(waveOutGetPosition(%s): returned %s\n",
dev_name(device), wave_time_format(mmtime.wType));
returned = time_to_bytes(&mmtime, pwfx);
ok(returned == bytes, "waveOutGetPosition(%s): returned %d bytes, "
"should be %d\n", dev_name(device), returned, bytes);
ok(returned == bytes, "waveOutGetPosition(%s): returned %ld bytes, "
"should be %ld\n", dev_name(device), returned, bytes);
mmtime.wType = TIME_SAMPLES;
rc=waveOutGetPosition(wout, &mmtime, sizeof(mmtime));
......@@ -496,8 +496,8 @@ static void check_position(int device, HWAVEOUT wout, DWORD bytes,
ok(mmtime.wType == TIME_SAMPLES, "(waveOutGetPosition(%s): returned %s\n",
dev_name(device), wave_time_format(mmtime.wType));
returned = time_to_bytes(&mmtime, pwfx);
ok(returned == bytes, "waveOutGetPosition(%s): returned %d samples "
"(%d bytes), should be %d (%d bytes)\n", dev_name(device),
ok(returned == bytes, "waveOutGetPosition(%s): returned %ld samples "
"(%ld bytes), should be %ld (%ld bytes)\n", dev_name(device),
bytes_to_samples(returned, pwfx), returned,
bytes_to_samples(bytes, pwfx), bytes);
......@@ -644,7 +644,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
(!(flags & WAVE_FORMAT_DIRECT) || (flags & WAVE_MAPPED)) &&
!(pcaps->dwFormats & format)) ||
(rc==MMSYSERR_INVALFLAG && (flags & WAVE_FORMAT_DIRECT)),
"waveOutOpen(%s): format=%dx%2dx%d flags=%x(%s) rc=%s\n",
"waveOutOpen(%s): format=%ldx%2dx%d flags=%lx(%s) rc=%s\n",
dev_name(device),pwfx->nSamplesPerSec,pwfx->wBitsPerSample,
pwfx->nChannels,flags,wave_open_flags(flags),wave_out_error(rc));
if ((rc==WAVERR_BADFORMAT || rc==MMSYSERR_NOTSUPPORTED) &&
......@@ -653,7 +653,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
"capabilities but opening it failed.\n");
if ((rc==WAVERR_BADFORMAT || rc==MMSYSERR_NOTSUPPORTED) &&
!(pcaps->dwFormats & format))
trace("waveOutOpen(%s): format=%dx%2dx%d %s rc=%s failed but format "
trace("waveOutOpen(%s): format=%ldx%2dx%d %s rc=%s failed but format "
"not supported so OK.\n", dev_name(device), pwfx->nSamplesPerSec,
pwfx->wBitsPerSample,pwfx->nChannels,
flags & WAVE_FORMAT_DIRECT ? "flags=WAVE_FORMAT_DIRECT" :
......@@ -667,7 +667,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
ok(pwfx->nChannels==nChannels &&
pwfx->wBitsPerSample==wBitsPerSample &&
pwfx->nSamplesPerSec==nSamplesPerSec,
"got the wrong format: %dx%2dx%d instead of %dx%2dx%d\n",
"got the wrong format: %ldx%2dx%d instead of %ldx%2dx%d\n",
pwfx->nSamplesPerSec, pwfx->wBitsPerSample,
pwfx->nChannels, nSamplesPerSec, wBitsPerSample, nChannels);
......@@ -719,7 +719,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
}
if (interactive && rc==MMSYSERR_NOERROR) {
trace("Playing %g second %s at %5dx%2dx%d %2d header%s %d loop%s %d bytes %s %s\n",duration,
trace("Playing %g second %s at %5ldx%2dx%d %2d header%s %d loop%s %ld bytes %s %s\n",duration,
sine ? "440 Hz tone" : "silence", pwfx->nSamplesPerSec,
pwfx->wBitsPerSample,pwfx->nChannels, headers, headers > 1 ? "s": " ",
loops, loops == 1 ? " " : "s", length * (loops + 1),
......@@ -801,27 +801,27 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
wave_out_error(rc));
}
ok(frags[0].dwFlags==(interactive ? WHDR_DONE : 0), "dwFlags(%d)=%x\n",device,frags[0].dwFlags);
ok(frags[0].dwFlags==(interactive ? WHDR_DONE : 0), "dwFlags(%d)=%lx\n",device,frags[0].dwFlags);
frags[0].dwFlags |= WHDR_DONE;
rc=waveOutUnprepareHeader(wout, &frags[0], sizeof(frags[0]));
ok(rc==MMSYSERR_NOERROR, "waveOutUnprepareHeader(%d): rc=%s\n",device,wave_out_error(rc));
ok(frags[0].dwFlags==WHDR_DONE, "dwFlags(%d)=%x\n",device,frags[0].dwFlags);
ok(frags[0].dwFlags==WHDR_DONE, "dwFlags(%d)=%lx\n",device,frags[0].dwFlags);
frags[0].dwFlags |= WHDR_INQUEUE;
rc=waveOutPrepareHeader(wout, &frags[0], sizeof(frags[0]));
ok(rc==MMSYSERR_NOERROR, "waveOutPrepareHeader(%d): rc=%s\n",device,wave_out_error(rc));
ok(frags[0].dwFlags==WHDR_PREPARED, "dwFlags(%d)=%x\n",device,frags[0].dwFlags);
ok(frags[0].dwFlags==WHDR_PREPARED, "dwFlags(%d)=%lx\n",device,frags[0].dwFlags);
frags[0].dwFlags |= WHDR_INQUEUE;
rc=waveOutPrepareHeader(wout, &frags[0], sizeof(frags[0]));
ok(rc==MMSYSERR_NOERROR, "waveOutPrepareHeader(%d): rc=%s\n",device,wave_out_error(rc));
ok(frags[0].dwFlags==(WHDR_PREPARED|WHDR_INQUEUE), "dwFlags(%d)=%x\n",device,frags[0].dwFlags);
ok(frags[0].dwFlags==(WHDR_PREPARED|WHDR_INQUEUE), "dwFlags(%d)=%lx\n",device,frags[0].dwFlags);
frags[0].dwFlags &= ~(WHDR_INQUEUE|WHDR_DONE);
rc=waveOutUnprepareHeader(wout, &frags[0], sizeof(frags[0]));
ok(rc==MMSYSERR_NOERROR, "waveOutUnprepareHeader(%d): rc=%s\n",device,wave_out_error(rc));
ok(frags[0].dwFlags==0, "dwFlags(%d)=%x\n",device,frags[0].dwFlags);
ok(frags[0].dwFlags==0, "dwFlags(%d)=%lx\n",device,frags[0].dwFlags);
rc=waveOutClose(wout);
ok(rc==MMSYSERR_NOERROR,"waveOutClose(%s): rc=%s\n",dev_name(device),
......@@ -953,7 +953,7 @@ static void wave_out_test_device(UINT_PTR device)
(DWORD_PTR)nameW, size);
ok(rc==MMSYSERR_NOERROR,"waveOutMessage(%s): failed to get interface "
"name, rc=%s\n",dev_name(device),wave_out_error(rc));
ok(lstrlenW(nameW)+1==size/sizeof(WCHAR),"got an incorrect size %d\n",size);
ok(lstrlenW(nameW)+1==size/sizeof(WCHAR),"got an incorrect size %ld\n",size);
if (rc==MMSYSERR_NOERROR) {
nameA = HeapAlloc(GetProcessHeap(), 0, size/sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, nameW, size/sizeof(WCHAR), nameA,
......@@ -979,7 +979,7 @@ static void wave_out_test_device(UINT_PTR device)
trace(" %s: \"%s\" (%s) %d.%d (%d:%d)\n",dev_name(device),capsA.szPname,
(nameA?nameA:"failed"),capsA.vDriverVersion >> 8,
capsA.vDriverVersion & 0xff, capsA.wMid,capsA.wPid);
trace(" channels=%d formats=%05x support=%04x\n",
trace(" channels=%d formats=%05lx support=%04lx\n",
capsA.wChannels,capsA.dwFormats,capsA.dwSupport);
trace(" %s\n",wave_out_caps(capsA.dwSupport));
HeapFree(GetProcessHeap(), 0, nameA);
......@@ -1454,7 +1454,7 @@ static void wave_out_tests(void)
if(rc != MMSYSERR_NOTSUPPORTED)
ok((ndev == 0 && (preferred == -1 || broken(preferred != -1))) ||
preferred < ndev, "Got invalid preferred device: 0x%x\n", preferred);
preferred < ndev, "Got invalid preferred device: 0x%lx\n", preferred);
rc = waveOutMessage((HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET,
(DWORD_PTR)-1 , 0);
......@@ -1596,7 +1596,7 @@ static void test_fragmentsize(void)
rc = waveOutPrepareHeader(wout, &hdr[1], sizeof(hdr[1]));
ok(rc == MMSYSERR_NOERROR, "waveOutPrepareHeader failed: %s\n", wave_out_error(rc));
trace("writing %u bytes then %u bytes\n", hdr[0].dwBufferLength, hdr[1].dwBufferLength);
trace("writing %lu bytes then %lu bytes\n", hdr[0].dwBufferLength, hdr[1].dwBufferLength);
rc = waveOutWrite(wout, &hdr[0], sizeof(hdr[0]));
ok(rc == MMSYSERR_NOERROR, "waveOutWrite failed: %s\n", wave_out_error(rc));
......@@ -1617,7 +1617,7 @@ static void test_fragmentsize(void)
/* windows behavior is inconsistent */
ok(mmtime.u.cb == 88200 ||
mmtime.u.cb == 88196, "after position: %u\n", mmtime.u.cb);
mmtime.u.cb == 88196, "after position: %lu\n", mmtime.u.cb);
rc = waveOutClose(wout);
ok(rc == MMSYSERR_NOERROR, "waveOutClose failed: %s\n", wave_out_error(rc));
......@@ -1758,7 +1758,7 @@ static void create_wav_file(char *temp_file)
rc = mmioCreateChunk(h, &chunk, 0);
ok(rc == MMSYSERR_NOERROR, "mmioCreateChunk failed, got %u\n", rc);
written = mmioWrite(h, (char*)&format, sizeof(format));
ok(written == sizeof(format), "mmioWrite failed, got %d\n", written);
ok(written == sizeof(format), "mmioWrite failed, got %ld\n", written);
rc = mmioAscend(h, &chunk, 0);
ok(rc == MMSYSERR_NOERROR, "mmioAscend failed, got %d\n", rc);
......@@ -1767,7 +1767,7 @@ static void create_wav_file(char *temp_file)
ok(rc == MMSYSERR_NOERROR, "mmioCreateChunk failed, got %u\n", rc);
buffer = wave_generate_silence(&format, .1, &length);
written = mmioWrite(h, buffer, length);
ok(written == length, "mmioWrite failed, got %d\n", written);
ok(written == length, "mmioWrite failed, got %ld\n", written);
rc = mmioAscend(h, &chunk, 0);
ok(rc == MMSYSERR_NOERROR, "mmioAscend failed, got %d\n", rc);
HeapFree(GetProcessHeap(), 0, buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment