From f16cda7e63cae5425322c0c2cb4319e76cc990cb Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Wed, 21 Apr 2021 12:53:33 +0700 Subject: [PATCH] amstream/tests: Add a test for event parameter of IDirectDrawStreamSample::Update. Signed-off-by: Anton Baskanov Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard (cherry picked from commit 3088ce35cbcadf330fd5c66d8be7908876fd0ca3) Signed-off-by: Michael Stefaniuc --- dlls/amstream/tests/amstream.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 648d5ee93c3..c5089a82f23 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -7795,6 +7795,22 @@ static void test_ddrawstreamsample_update(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IDirectDrawStreamSample_Update(stream_sample, 0, event, NULL, 0); + todo_wine ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + + ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); + + if (hr == MS_S_PENDING) + { + media_sample = ammediastream_allocate_sample(&source, test_data, sizeof(test_data)); + hr = IMemInputPin_Receive(source.source.pMemInputPin, media_sample); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = IMediaSample_Release(media_sample); + ok(!ref, "Got outstanding refcount %d.\n", ref); + } + + todo_wine ok(WaitForSingleObject(event, 0) == 0, "Event should be signaled.\n"); + hr = IDirectDrawStreamSample_Update(stream_sample, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); EXPECT_REF(stream_sample, 1);