msacm32/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-01 08:33:25 +01:00 committed by Alexandre Julliard
parent 8e1b054be4
commit f6483b2112
2 changed files with 38 additions and 39 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = msacm32.dll
IMPORTS = msacm32 winmm

View File

@ -42,7 +42,7 @@ static BOOL CALLBACK FormatTagEnumProc(HACMDRIVERID hadid,
HACMDRIVER had;
if (winetest_interactive)
trace(" Format 0x%04x: %s\n", paftd->dwFormatTag, paftd->szFormatTag);
trace(" Format 0x%04lx: %s\n", paftd->dwFormatTag, paftd->szFormatTag);
rc = acmDriverOpen(&had, hadid, 0);
ok(rc == MMSYSERR_NOERROR || rc == MMSYSERR_NODRIVER,
@ -243,7 +243,7 @@ static BOOL CALLBACK FormatEnumProc(HACMDRIVERID hadid,
acmMetrics((HACMOBJ)hadid, ACM_METRIC_DRIVER_SUPPORT, &fdwSupport);
if (winetest_interactive)
trace(" 0x%04x, %s\n", pafd->dwFormatTag, pafd->szFormat);
trace(" 0x%04lx, %s\n", pafd->dwFormatTag, pafd->szFormat);
acmDriverOpen(&had, hadid, 0);
dwSize = pafd->cbwfx;
@ -278,7 +278,7 @@ static BOOL CALLBACK FormatEnumProc(HACMDRIVERID hadid,
"expected %d, got %d\n", pafd->pwfx->nChannels, dst->nChannels);
if (pafd->dwFormatTag != 0x42) /* codec 0x0042 returns a different sample rate */
ok(dst->nSamplesPerSec == pafd->pwfx->nSamplesPerSec,
"expected %d, got %d\n", pafd->pwfx->nSamplesPerSec, dst->nSamplesPerSec);
"expected %ld, got %ld\n", pafd->pwfx->nSamplesPerSec, dst->nSamplesPerSec);
ok(dst->wBitsPerSample == 16,
"expected %d, got %d\n", 16, dst->wBitsPerSample);
ok(dst->nBlockAlign == 2*pafd->pwfx->nChannels,
@ -402,7 +402,7 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
};
ok(dd.cbStruct == sizeof(dd),
"acmDriverDetailsA(): cbStruct = %08x\n", dd.cbStruct);
"acmDriverDetailsA(): cbStruct = %08lx\n", dd.cbStruct);
for (iter = expected_ids; iter->shortname; ++iter) {
if (!strcmp(iter->shortname, dd.szShortName)) {
@ -427,8 +427,8 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
trace(" Copyright: %s\n", dd.szCopyright);
trace(" Licensing: %s\n", dd.szLicensing);
trace(" Features: %s\n", dd.szFeatures);
trace(" Supports %u formats\n", dd.cFormatTags);
trace(" Supports %u filter formats\n", dd.cFilterTags);
trace(" Supports %lu formats\n", dd.cFormatTags);
trace(" Supports %lu filter formats\n", dd.cFilterTags);
trace(" Mid: 0x%x\n", dd.wMid);
trace(" Pid: 0x%x\n", dd.wPid);
}
@ -802,7 +802,7 @@ static void check_count(UINT uMetric)
ok(rc == MMSYSERR_NOERROR, "acmMetrics() failed: rc = 0x%08x\n", rc);
if (rc == MMSYSERR_NOERROR && winetest_interactive)
trace("%s: %u\n", get_metric(uMetric), dwMetric);
trace("%s: %lu\n", get_metric(uMetric), dwMetric);
}
static void driver_tests(void)
@ -896,11 +896,11 @@ static void test_prepareheader(void)
mr = acmStreamPrepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%lx\n", hdr.fdwStatus);
mr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == 0, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == 0, "header wasn't unprepared: 0x%lx\n", hdr.fdwStatus);
memset(&hdr, 0, sizeof(hdr));
hdr.cbStruct = sizeof(hdr);
@ -943,21 +943,21 @@ static void test_prepareheader(void)
mr = acmStreamPrepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == (ACMSTREAMHEADER_STATUSF_PREPARED | ACMSTREAMHEADER_STATUSF_DONE), "header wasn't prepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == (ACMSTREAMHEADER_STATUSF_PREPARED | ACMSTREAMHEADER_STATUSF_DONE), "header wasn't prepared: 0x%lx\n", hdr.fdwStatus);
hdr.cbSrcLengthUsed = 12345;
hdr.cbDstLengthUsed = 12345;
hdr.fdwStatus &= ~ACMSTREAMHEADER_STATUSF_DONE;
mr = acmStreamConvert(has, &hdr, ACM_STREAMCONVERTF_BLOCKALIGN);
ok(mr == MMSYSERR_NOERROR, "convert failed: 0x%x\n", mr);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%x\n", hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %d, got %d\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%lx\n", hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %ld, got %ld\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
todo_wine
ok(hdr.cbDstLengthUsed == 1010, "expected 1010, got %d\n", hdr.cbDstLengthUsed);
ok(hdr.cbDstLengthUsed == 1010, "expected 1010, got %ld\n", hdr.cbDstLengthUsed);
mr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%lx\n", hdr.fdwStatus);
/* The 2 next tests are related to Lost Horizon (bug 24723) */
memset(&hdr, 0, sizeof(hdr));
@ -971,21 +971,21 @@ static void test_prepareheader(void)
if (sizeof(void *) == 4) /* 64 bit fails on this test */
{
ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%lx\n", hdr.fdwStatus);
hdr.cbSrcLengthUsed = 12345;
hdr.cbDstLengthUsed = 12345;
hdr.fdwStatus &= ~ACMSTREAMHEADER_STATUSF_DONE;
mr = acmStreamConvert(has, &hdr, ACM_STREAMCONVERTF_BLOCKALIGN);
ok(mr == MMSYSERR_NOERROR, "convert failed: 0x%x\n", mr);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%x\n", hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %d, got %d\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%lx\n", hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %ld, got %ld\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
todo_wine
ok(hdr.cbDstLengthUsed == 1010, "expected 1010, got %d\n", hdr.cbDstLengthUsed);
ok(hdr.cbDstLengthUsed == 1010, "expected 1010, got %ld\n", hdr.cbDstLengthUsed);
mr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%lx\n", hdr.fdwStatus);
}
else
todo_wine
@ -999,14 +999,14 @@ static void test_prepareheader(void)
hdr.cbDstLength = -4;
mr = acmStreamPrepareHeader(has, &hdr, 0);
ok(mr == ACMERR_NOTPOSSIBLE, "expected 0x200, got 0x%x\n", mr);
ok(hdr.fdwStatus == 0, "expected 0, got 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == 0, "expected 0, got 0x%lx\n", hdr.fdwStatus);
hdr.cbSrcLengthUsed = 12345;
hdr.cbDstLengthUsed = 12345;
mr = acmStreamConvert(has, &hdr, ACM_STREAMCONVERTF_BLOCKALIGN);
ok(mr == ACMERR_UNPREPARED, "expected 0x202, got 0x%x\n", mr);
ok(hdr.cbSrcLengthUsed == 12345, "expected 12345, got %d\n", hdr.cbSrcLengthUsed);
ok(hdr.cbDstLengthUsed == 12345, "expected 12345, got %d\n", hdr.cbDstLengthUsed);
ok(hdr.cbSrcLengthUsed == 12345, "expected 12345, got %ld\n", hdr.cbSrcLengthUsed);
ok(hdr.cbDstLengthUsed == 12345, "expected 12345, got %ld\n", hdr.cbDstLengthUsed);
mr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mr == ACMERR_UNPREPARED, "expected 0x202, got 0x%x\n", mr);
@ -1021,22 +1021,22 @@ static void test_prepareheader(void)
mr = acmStreamPrepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "header wasn't prepared: 0x%lx\n", hdr.fdwStatus);
hdr.cbSrcLengthUsed = 12345;
hdr.cbDstLengthUsed = 12345;
hdr.fdwStatus &= ~ACMSTREAMHEADER_STATUSF_DONE;
mr = acmStreamConvert(has, &hdr, ACM_STREAMCONVERTF_BLOCKALIGN);
ok(mr == MMSYSERR_NOERROR, "convert failed: 0x%x\n", mr);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "conversion was not done: 0x%lx\n", hdr.fdwStatus);
todo_wine
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %d, got %d\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "expected %ld, got %ld\n", hdr.cbSrcLength, hdr.cbSrcLengthUsed);
todo_wine
ok(hdr.cbDstLengthUsed == hdr.cbDstLength, "expected %d, got %d\n", hdr.cbDstLength, hdr.cbDstLengthUsed);
ok(hdr.cbDstLengthUsed == hdr.cbDstLength, "expected %ld, got %ld\n", hdr.cbDstLength, hdr.cbDstLengthUsed);
mr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%lx\n", hdr.fdwStatus);
mr = acmStreamClose(has, 0);
ok(mr == MMSYSERR_NOERROR, "close failed: 0x%x\n", mr);
@ -1121,20 +1121,20 @@ static void test_convert(void)
mmr = acmStreamPrepareHeader(has, &hdr, 0);
ok(mmr == MMSYSERR_NOERROR, "#%d: prepare failed: 0x%x\n", i, mmr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "#%d: header wasn't prepared: 0x%x\n", i, hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_PREPARED, "#%d: header wasn't prepared: 0x%lx\n", i, hdr.fdwStatus);
memset(&output, 0, sizeof(output));
mmr = acmStreamConvert(has, &hdr, ACM_STREAMCONVERTF_BLOCKALIGN);
ok(mmr == MMSYSERR_NOERROR, "#%d: convert failed: 0x%x\n", i, mmr);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "#%d: conversion was not done: 0x%x\n", i, hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "#%d: expected %d, got %d\n", i, hdr.cbSrcLength, hdr.cbSrcLengthUsed);
ok(hdr.cbDstLengthUsed == expected_output[i].dst_used, "#%d: expected %d, got %d\n", i, expected_output[i].dst_used, hdr.cbDstLengthUsed);
ok(hdr.fdwStatus & ACMSTREAMHEADER_STATUSF_DONE, "#%d: conversion was not done: 0x%lx\n", i, hdr.fdwStatus);
ok(hdr.cbSrcLengthUsed == hdr.cbSrcLength, "#%d: expected %ld, got %ld\n", i, hdr.cbSrcLength, hdr.cbSrcLengthUsed);
ok(hdr.cbDstLengthUsed == expected_output[i].dst_used, "#%d: expected %ld, got %ld\n", i, expected_output[i].dst_used, hdr.cbDstLengthUsed);
todo_wine_if(expected_output[i].todo)
ok(!memcmp(expected_output[i].output, output, hdr.cbDstLengthUsed), "#%d: output does not match\n", i);
mmr = acmStreamUnprepareHeader(has, &hdr, 0);
ok(mmr == MMSYSERR_NOERROR, "#%d: unprepare failed: 0x%x\n", i, mmr);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "#%d: header wasn't unprepared: 0x%x\n", i, hdr.fdwStatus);
ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "#%d: header wasn't unprepared: 0x%lx\n", i, hdr.fdwStatus);
mmr = acmStreamClose(has, 0);
ok(mmr == MMSYSERR_NOERROR, "#%d: close failed: 0x%x\n", i, mmr);
@ -1164,8 +1164,8 @@ static void test_acmFormatSuggest(void)
ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc);
ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag);
ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels);
ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec);
ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec);
ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %ld, got %ld\n", src.nSamplesPerSec, dst.nSamplesPerSec);
ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %ld, got %ld\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec);
ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign);
ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample);
@ -1179,8 +1179,8 @@ static void test_acmFormatSuggest(void)
ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc);
ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag);
ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels);
ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec);
ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec);
ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %ld, got %ld\n", src.nSamplesPerSec, dst.nSamplesPerSec);
ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %ld, got %ld\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec);
ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign);
ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample);
@ -1192,7 +1192,7 @@ static void test_acmFormatSuggest(void)
todo_wine {
ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc);
ok(dst.wFormatTag == WAVE_FORMAT_PCM, "expected %d, got %d\n", WAVE_FORMAT_PCM, dst.wFormatTag);
ok(dst.nSamplesPerSec == 0xdeadbeef, "expected %d, got %d\n", 0xdeadbeef, dst.nSamplesPerSec);
ok(dst.nSamplesPerSec == 0xdeadbeef, "expected %d, got %ld\n", 0xdeadbeef, dst.nSamplesPerSec);
}
src.nSamplesPerSec = 8000;
@ -1247,7 +1247,7 @@ static void test_acmFormatTagDetails(void)
aftd.dwFormatTag = WAVE_FORMAT_MPEGLAYER3;
rc = acmFormatTagDetailsW(NULL, &aftd, ACM_FORMATTAGDETAILSF_FORMATTAG);
if (rc == MMSYSERR_NOERROR)
ok(aftd.cbFormatSize == sizeof(MPEGLAYER3WAVEFORMAT), "got %d\n", aftd.cbFormatSize);
ok(aftd.cbFormatSize == sizeof(MPEGLAYER3WAVEFORMAT), "got %ld\n", aftd.cbFormatSize);
}
static void test_acmFormatChoose(void)