From 9a06379d17f189440398ec0e3bab7af5fca2a075 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 27 Jun 2017 01:46:38 +0000 Subject: [PATCH] mfplat/tests: Added MFCreateMediaType test. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- dlls/mfplat/tests/mfplat.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 83e15386867..edbce460ece 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -191,6 +191,33 @@ static void init_functions(void) #undef X } +static void test_MFCreateMediaType(void) +{ + HRESULT hr; + IMFMediaType *mediatype; + + hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + +if(0) +{ + /* Crash on Windows Vista/7 */ + hr = MFCreateMediaType(NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); +} + + hr = MFCreateMediaType(&mediatype); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + + IMFMediaType_Release(mediatype); + + MFShutdown(); +} + + START_TEST(mfplat) { CoInitialize(NULL); @@ -199,6 +226,7 @@ START_TEST(mfplat) test_register(); test_source_resolver(); + test_MFCreateMediaType(); CoUninitialize(); }