[PATCH] dsound/tests: Add some GetStatus checks
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Sun Sep 29 20:00:24 CDT 2019
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
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);
--
2.17.1
More information about the wine-devel
mailing list