[PATCH v2 2/6] amstream/tests: Fix file rendering test.
Anton Baskanov
baskanov at gmail.com
Tue Jul 21 09:48:47 CDT 2020
Fixes the following issues:
- AddMediaStream with AMMSF_ADDDEFAULTRENDERER fails if there is no sound card.
- GetSurface actually returns a non-NULL surface as CreateSample creates the surface if it was not provided.
- CreateSample with the pdds7 surface fails with DDERR_INVALIDSURFACETYPE as the surface size does not match the video size.
Signed-off-by: Anton Baskanov <baskanov at gmail.com>
---
v2: Fixed a test failure.
---
dlls/amstream/tests/amstream.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c
index e962d85e73..9abb76b996 100644
--- a/dlls/amstream/tests/amstream.c
+++ b/dlls/amstream/tests/amstream.c
@@ -303,7 +303,7 @@ static void test_renderfile(void)
ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr);
hr = IAMMultiMediaStream_AddMediaStream(pams, NULL, &MSPID_PrimaryAudio, AMMSF_ADDDEFAULTRENDERER, NULL);
- ok(hr==S_OK, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr);
+ ok(hr==S_OK || hr==VFW_E_NO_AUDIO_HARDWARE, "IAMMultiMediaStream_AddMediaStream returned: %x\n", hr);
hr = IAMMultiMediaStream_OpenFile(pams, L"test.avi", 0);
ok(hr==S_OK, "IAMMultiMediaStream_OpenFile returned: %x\n", hr);
@@ -322,14 +322,15 @@ static void test_renderfile(void)
surface = NULL;
hr = IDirectDrawStreamSample_GetSurface(pddsample, &surface, &rect);
ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(surface == NULL, "got %p\n", surface);
+ ok(surface != NULL, "expected non-NULL surface\n");
+ IDirectDrawSurface_Release(surface);
IDirectDrawStreamSample_Release(pddsample);
hr = IDirectDrawSurface7_QueryInterface(pdds7, &IID_IDirectDrawSurface, (void**)&surface);
ok(hr == S_OK, "got 0x%08x\n", hr);
EXPECT_REF(surface, 1);
- hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, NULL, 0, &pddsample);
+ hr = IDirectDrawMediaStream_CreateSample(pddstream, surface, &rect, 0, &pddsample);
ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr);
EXPECT_REF(surface, 2);
IDirectDrawStreamSample_Release(pddsample);
--
2.17.1
More information about the wine-devel
mailing list