From 395b9c321b6788463d2e2f03b603600f8bb78454 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Fri, 27 Nov 2015 21:10:04 +0800 Subject: [PATCH] msacm32/tests: Add more acmStreamPrepareHeader tests. Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/msacm32/tests/msacm.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/msacm32/tests/msacm.c b/dlls/msacm32/tests/msacm.c index bb4ccc5dc9c..812a1bbf3a5 100644 --- a/dlls/msacm32/tests/msacm.c +++ b/dlls/msacm32/tests/msacm.c @@ -583,6 +583,33 @@ static void test_prepareheader(void) ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr); ok(hdr.fdwStatus == 0, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus); + memset(&hdr, 0, sizeof(hdr)); + hdr.cbStruct = sizeof(hdr); + hdr.pbSrc = input; + hdr.cbSrcLength = 0; /* invalid source length */ + hdr.pbDst = pcm; + hdr.cbDstLength = sizeof(pcm); + + mr = acmStreamPrepareHeader(has, &hdr, 0); +todo_wine + ok(mr == MMSYSERR_INVALPARAM, "expected 0x0b, got 0x%x\n", mr); + + hdr.cbSrcLength = src->wfx.nBlockAlign - 1; /* less than block align */ + mr = acmStreamPrepareHeader(has, &hdr, 0); +todo_wine + ok(mr == ACMERR_NOTPOSSIBLE, "expected 0x200, got 0x%x\n", mr); + + hdr.cbSrcLength = src->wfx.nBlockAlign; + mr = acmStreamPrepareHeader(has, &hdr, 1); /* invalid use of reserved parameter */ +todo_wine + ok(mr == MMSYSERR_INVALFLAG, "expected 0x0a, got 0x%x\n", mr); + + mr = acmStreamPrepareHeader(has, &hdr, 0); + ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr); + + mr = acmStreamUnprepareHeader(has, &hdr, 0); + ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr); + memset(&hdr, 0, sizeof(hdr)); hdr.cbStruct = sizeof(hdr); hdr.pbSrc = input; @@ -638,7 +665,8 @@ todo_wine ok(hdr.fdwStatus == ACMSTREAMHEADER_STATUSF_DONE, "header wasn't unprepared: 0x%x\n", hdr.fdwStatus); } else - ok(mr == MMSYSERR_INVALPARAM, "expected 11, got %d\n", mr); +todo_wine + ok(mr == MMSYSERR_INVALPARAM, "expected 0x0b, got 0x%x\n", mr); memset(&hdr, 0, sizeof(hdr)); hdr.cbStruct = sizeof(hdr);