[PATCH 3/3] mplat/test: Added MFCreateMediaType test

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue May 23 21:39:32 CDT 2017


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/mfplat/tests/mfplat.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index 4a95137bc4..2aa1f0d5f8 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -154,12 +154,38 @@ if(0)
     ok(ret == S_OK || broken(ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), "got %x\n", ret);
 }
 
+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);
 
     test_register();
+    test_MFCreateMediaType();
 
     CoUninitialize();
 }
-- 
2.11.0




More information about the wine-patches mailing list