Module: wine Branch: master Commit: b360cd67e8f7f8c01f09457bacb032fd4a248d0a URL: https://source.winehq.org/git/wine.git/?a=commit;h=b360cd67e8f7f8c01f09457ba...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Mon Sep 30 01:00:24 2019 +0000
dsound/tests: Add some GetStatus checks.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dsound/tests/dsound.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 41818deb17..d242bf6b24 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -1063,7 +1063,7 @@ static HRESULT test_notify(LPDIRECTSOUNDBUFFER dsb, DWORD expected) { HRESULT rc; - DWORD ret; + DWORD ret, status;
rc=IDirectSoundBuffer_SetCurrentPosition(dsb,0); ok(rc==DS_OK, @@ -1076,13 +1076,22 @@ static HRESULT test_notify(LPDIRECTSOUNDBUFFER dsb, if(rc!=DS_OK) return rc;
+ rc = IDirectSoundBuffer_GetStatus(dsb, &status); + ok(rc == DS_OK,"Failed %08x\n",rc); + ok(status == DSBSTATUS_PLAYING,"got %08x\n", status); + rc=IDirectSoundBuffer_Stop(dsb); ok(rc==DS_OK,"IDirectSoundBuffer_Stop failed %08x\n",rc); if(rc!=DS_OK) return rc;
+ rc = IDirectSoundBuffer_GetStatus(dsb, &status); + ok(rc == DS_OK,"Failed %08x\n",rc); + ok(status == 0 /* Stopped */,"got %08x\n", status); + ret=WaitForMultipleObjects(count,event,FALSE,0); ok(ret==expected,"expected %d. got %d\n",expected,ret); + return rc; }
@@ -1537,7 +1546,7 @@ static void test_notifications(LPGUID lpGuid) WAVEFORMATEX wfx; DSBPOSITIONNOTIFY notifies[2]; HANDLE handles[2]; - DWORD expect; + DWORD expect, status; int cycles;
rc = pDirectSoundCreate(lpGuid, &dso, NULL); @@ -1607,12 +1616,20 @@ static void test_notifications(LPGUID lpGuid) ok(wait <= WAIT_OBJECT_0 + 1 && wait - WAIT_OBJECT_0 == expect, "Got unexpected notification order or timeout: %u\n", wait);
+ rc = IDirectSoundBuffer_GetStatus(buf, &status); + ok(rc == DS_OK,"Failed %08x\n",rc); + ok(status == (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING),"got %08x\n", status); + expect = !expect; }
rc = IDirectSoundBuffer_Stop(buf); ok(rc == DS_OK, "Stop: %08x\n", rc);
+ rc = IDirectSoundBuffer_GetStatus(buf, &status); + ok(rc == DS_OK,"Failed %08x\n",rc); + ok(status == 0,"got %08x\n", status); + CloseHandle(notifies[0].hEventNotify); CloseHandle(notifies[1].hEventNotify);