https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f302bfa196de8a5610dc6…
commit f302bfa196de8a5610dc6ff3ee3289329cffd119
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Mar 18 12:23:28 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Mar 18 12:23:28 2018 +0100
[MSACM32_WINETEST] Sync with Wine Staging 3.3. CORE-14434
---
modules/rostests/winetests/msacm32/msacm.c | 71 ++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/modules/rostests/winetests/msacm32/msacm.c
b/modules/rostests/winetests/msacm32/msacm.c
index a484896cce..ce1837c0a8 100644
--- a/modules/rostests/winetests/msacm32/msacm.c
+++ b/modules/rostests/winetests/msacm32/msacm.c
@@ -1276,6 +1276,76 @@ static void test_acmFormatChoose(void)
HeapFree(GetProcessHeap(), 0, pwfx);
}
+static void test_mp3(void)
+{
+ MPEGLAYER3WAVEFORMAT src;
+ WAVEFORMATEX dst;
+ HACMSTREAM has;
+ DWORD output;
+ MMRESULT mr;
+
+ src.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3;
+ src.wfx.nSamplesPerSec = 11025;
+ src.wfx.wBitsPerSample = 0;
+ src.wfx.nChannels = 1;
+ src.wfx.nBlockAlign = 576;
+ src.wfx.nAvgBytesPerSec = 2000;
+
+ src.wID = MPEGLAYER3_ID_MPEG;
+ src.fdwFlags = 0;
+ src.nBlockSize = 576;
+ src.nFramesPerBlock = 1;
+ src.nCodecDelay = 0;
+
+ dst.cbSize = 0;
+ dst.wFormatTag = WAVE_FORMAT_PCM;
+ dst.nSamplesPerSec = 11025;
+ dst.wBitsPerSample = 16;
+ dst.nChannels = 1;
+ dst.nBlockAlign = dst.wBitsPerSample * dst.nChannels / 8;
+ dst.nAvgBytesPerSec = dst.nSamplesPerSec * dst.nBlockAlign;
+
+ src.wfx.cbSize = 0;
+
+ mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0,
0);
+ ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got
0x%x\n", mr);
+ if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0);
+
+ src.wfx.cbSize = MPEGLAYER3_WFX_EXTRA_BYTES;
+ src.wID = 0;
+
+ mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0,
0);
+ ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got
0x%x\n", mr);
+ if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0);
+
+ src.wID = MPEGLAYER3_ID_MPEG;
+ src.nBlockSize = 0;
+
+ mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0,
0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+ mr = acmStreamClose(has, 0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+
+ src.nBlockSize = 576;
+ src.wfx.nAvgBytesPerSec = 0;
+
+ mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0,
0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+ /* causes a division by zero exception */
+ if (0) acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE);
+ mr = acmStreamClose(has, 0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+
+ src.wfx.nAvgBytesPerSec = 2000;
+
+ mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0,
0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+ mr = acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+ mr = acmStreamClose(has, 0);
+ ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr);
+}
+
static struct
{
struct
@@ -1446,6 +1516,7 @@ START_TEST(msacm)
test_acmFormatSuggest();
test_acmFormatTagDetails();
test_acmFormatChoose();
+ test_mp3();
/* Test acmDriverAdd in the end as it may conflict
* with other tests due to codec lookup order */
test_acmDriverAdd();