msacm32/tests: Allow alternative product id.

This commit is contained in:
Nikolay Sivov 2015-09-21 21:13:24 +03:00 committed by Alexandre Julliard
parent c0308873b9
commit bc26431e94
2 changed files with 14 additions and 5 deletions

View File

@ -127,15 +127,16 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
TODO: should it be *exactly* sizeof(dd), as tested here? TODO: should it be *exactly* sizeof(dd), as tested here?
*/ */
if (rc == MMSYSERR_NOERROR) { if (rc == MMSYSERR_NOERROR) {
struct { static const struct {
const char *shortname; const char *shortname;
const WORD mid; WORD mid;
const WORD pid; WORD pid;
WORD pid_alt;
} *iter, expected_ids[] = { } *iter, expected_ids[] = {
{ "Microsoft IMA ADPCM", MM_MICROSOFT, MM_MSFT_ACM_IMAADPCM }, { "Microsoft IMA ADPCM", MM_MICROSOFT, MM_MSFT_ACM_IMAADPCM },
{ "MS-ADPCM", MM_MICROSOFT, MM_MSFT_ACM_MSADPCM }, { "MS-ADPCM", MM_MICROSOFT, MM_MSFT_ACM_MSADPCM },
{ "Microsoft CCITT G.711", MM_MICROSOFT, MM_MSFT_ACM_G711}, { "Microsoft CCITT G.711", MM_MICROSOFT, MM_MSFT_ACM_G711},
{ "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE }, { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE, MM_FHGIIS_MPEGLAYER3_PROFESSIONAL },
{ "MS-PCM", MM_MICROSOFT, MM_MSFT_ACM_PCM }, { "MS-PCM", MM_MICROSOFT, MM_MSFT_ACM_PCM },
{ 0 } { 0 }
}; };
@ -145,6 +146,13 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
for (iter = expected_ids; iter->shortname; ++iter) { for (iter = expected_ids; iter->shortname; ++iter) {
if (dd.szShortName && !strcmp(iter->shortname, dd.szShortName)) { if (dd.szShortName && !strcmp(iter->shortname, dd.szShortName)) {
/* try alternative product id on mismatch */
if (iter->pid_alt && iter->pid != dd.wPid)
ok(iter->mid == dd.wMid && iter->pid_alt == dd.wPid,
"Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n",
dd.wMid, iter->mid,
dd.wPid, iter->pid_alt);
else
ok(iter->mid == dd.wMid && iter->pid == dd.wPid, ok(iter->mid == dd.wMid && iter->pid == dd.wPid,
"Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n",
dd.wMid, iter->mid, dd.wMid, iter->mid,

View File

@ -129,6 +129,7 @@ typedef struct _WAVEFORMATEX {
#define MM_FRAUNHOFER_IIS 0xAC #define MM_FRAUNHOFER_IIS 0xAC
#define MM_FHGIIS_MPEGLAYER3_DECODE 0x09 #define MM_FHGIIS_MPEGLAYER3_DECODE 0x09
#define MM_FHGIIS_MPEGLAYER3_PROFESSIONAL 0x0d
#if !defined(WAVE_FORMAT_EXTENSIBLE) #if !defined(WAVE_FORMAT_EXTENSIBLE)
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */ #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */