Commit 04c3a9ba authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

amstream/tests: Add tests for GetMultiMediaStream methods.

parent 355a3248
......@@ -253,6 +253,7 @@ static void test_media_streams(void)
if (video_stream)
{
IAMMediaStream* am_media_stream;
IMultiMediaStream *multi_media_stream;
IAudioMediaStream* audio_media_stream;
IDirectDrawMediaStream *ddraw_stream = NULL;
IDirectDrawStreamSample *ddraw_sample = NULL;
......@@ -260,8 +261,20 @@ static void test_media_streams(void)
hr = IMediaStream_QueryInterface(video_stream, &IID_IAMMediaStream, (LPVOID*)&am_media_stream);
ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr);
ok((void*)am_media_stream == (void*)video_stream, "Not same interface, got %p expected %p\n", am_media_stream, video_stream);
hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, NULL);
todo_wine ok(hr == E_POINTER, "Expected E_POINTER, got %x\n", hr);
multi_media_stream = (void *)0xdeadbeef;
hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
todo_wine ok(hr == S_OK, "IAMMediaStream_GetMultiMediaStream returned: %x\n", hr);
if (hr == S_OK)
IAMMediaStream_Release(am_media_stream);
{
ok((void *)multi_media_stream == (void *)pams, "Expected %p, got %p\n", pams, multi_media_stream);
IMultiMediaStream_Release(multi_media_stream);
}
IAMMediaStream_Release(am_media_stream);
hr = IMediaStream_QueryInterface(video_stream, &IID_IAudioMediaStream, (LPVOID*)&audio_media_stream);
ok(hr == E_NOINTERFACE, "IMediaStream_QueryInterface returned: %x\n", hr);
......@@ -280,6 +293,18 @@ static void test_media_streams(void)
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &ddraw_sample);
ok(hr == S_OK, "IDirectDrawMediaStream_CreateSample returned: %x\n", hr);
hr = IDirectDrawMediaStream_GetMultiMediaStream(ddraw_stream, NULL);
todo_wine ok(hr == E_POINTER, "Expected E_POINTER, got %x\n", hr);
multi_media_stream = (void *)0xdeadbeef;
hr = IDirectDrawMediaStream_GetMultiMediaStream(ddraw_stream, &multi_media_stream);
todo_wine ok(hr == S_OK, "IDirectDrawMediaStream_GetMultiMediaStream returned: %x\n", hr);
if (hr == S_OK)
{
ok((void *)multi_media_stream == (void *)pams, "Expected %p, got %p\n", pams, multi_media_stream);
IMultiMediaStream_Release(multi_media_stream);
}
}
if (ddraw_sample)
......@@ -344,6 +369,7 @@ static void test_media_streams(void)
if (audio_stream)
{
IAMMediaStream* am_media_stream;
IMultiMediaStream *multi_media_stream;
IDirectDrawMediaStream* ddraw_stream = NULL;
IAudioMediaStream* audio_media_stream = NULL;
IAudioStreamSample *audio_sample = NULL;
......@@ -351,8 +377,20 @@ static void test_media_streams(void)
hr = IMediaStream_QueryInterface(audio_stream, &IID_IAMMediaStream, (LPVOID*)&am_media_stream);
ok(hr == S_OK, "IMediaStream_QueryInterface returned: %x\n", hr);
ok((void*)am_media_stream == (void*)audio_stream, "Not same interface, got %p expected %p\n", am_media_stream, audio_stream);
hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, NULL);
todo_wine ok(hr == E_POINTER, "Expected E_POINTER, got %x\n", hr);
multi_media_stream = (void *)0xdeadbeef;
hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
todo_wine ok(hr == S_OK, "IAMMediaStream_GetMultiMediaStream returned: %x\n", hr);
if (hr == S_OK)
IAMMediaStream_Release(am_media_stream);
{
ok((void *)multi_media_stream == (void *)pams, "Expected %p, got %p\n", pams, multi_media_stream);
IMultiMediaStream_Release(multi_media_stream);
}
IAMMediaStream_Release(am_media_stream);
hr = IMediaStream_QueryInterface(audio_stream, &IID_IDirectDrawMediaStream, (LPVOID*)&ddraw_stream);
ok(hr == E_NOINTERFACE, "IMediaStream_QueryInterface returned: %x\n", hr);
......@@ -378,6 +416,18 @@ static void test_media_streams(void)
hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &audio_sample);
ok(hr == S_OK, "IAudioMediaStream_CreateSample returned: %x\n", hr);
hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream, NULL);
todo_wine ok(hr == E_POINTER, "Expected E_POINTER, got %x\n", hr);
multi_media_stream = (void *)0xdeadbeef;
hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream, &multi_media_stream);
todo_wine ok(hr == S_OK, "IAudioMediaStream_GetMultiMediaStream returned: %x\n", hr);
if (hr == S_OK)
{
ok((void *)multi_media_stream == (void *)pams, "Expected %p, got %p\n", pams, multi_media_stream);
IMultiMediaStream_Release(multi_media_stream);
}
if (audio_data)
IAudioData_Release(audio_data);
if (audio_sample)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment