Remove patch '0001-quartz-tests-Add-tests-for-IVMRMonitorConfig-and-IVMRM.patch'.

This commit is contained in:
Sebastian Lackner 2014-07-06 23:40:17 +02:00
parent 5721ee15c9
commit b500367ff7
6 changed files with 1 additions and 366 deletions

View File

@ -1,360 +0,0 @@
From 4347b37128afcd1878a0f993a058fe147f219982 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 22 Nov 2013 18:40:59 +0100
Subject: quartz/tests: Add tests for IVMRMonitorConfig and IVMRMonitorConfig9
interface
---
dlls/quartz/tests/videorenderer.c | 275 ++++++++++++++++++++++++++++++++++---
1 file changed, 254 insertions(+), 21 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index ce1ac29..e3a4fa2 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -22,6 +22,9 @@
#include "wine/test.h"
#include "dshow.h"
+#include "initguid.h"
+#include "d3d9.h"
+#include "vmr9.h"
#define QI_SUCCEED(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \
ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \
@@ -32,28 +35,17 @@
ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
}
-static IUnknown *pVideoRenderer = NULL;
-
-static int create_video_renderer(void)
+static const WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{
- HRESULT hr;
-
- hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER,
- &IID_IUnknown, (LPVOID*)&pVideoRenderer);
- return (hr == S_OK && pVideoRenderer != NULL);
-}
-
-static void release_video_renderer(void)
-{
- HRESULT hr;
-
- hr = IUnknown_Release(pVideoRenderer);
- ok(hr == 0, "IUnknown_Release failed with %x\n", hr);
+ const WCHAR *end;
+ for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return ptr;
+ return NULL;
}
static void test_query_interface(void)
{
HRESULT hr;
+ IUnknown *pVideoRenderer = NULL;
IBaseFilter *pBaseFilter = NULL;
IBasicVideo *pBasicVideo = NULL;
IDirectDrawVideo *pDirectDrawVideo = NULL;
@@ -64,6 +56,15 @@ static void test_query_interface(void)
IQualProp *pQualProp = NULL;
IVideoWindow *pVideoWindow = NULL;
+ hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (LPVOID*)&pVideoRenderer);
+ ok(hr != S_OK || pVideoRenderer != NULL, "CoCreateInstance returned S_OK, but pVideoRenderer is NULL.\n");
+ if (hr != S_OK || !pVideoRenderer)
+ {
+ skip("VideoRenderer is not available, skipping QI test.\n");
+ return;
+ }
+
QI_SUCCEED(pVideoRenderer, IID_IBaseFilter, pBaseFilter);
RELEASE_EXPECT(pBaseFilter, 1);
QI_SUCCEED(pVideoRenderer, IID_IBasicVideo, pBasicVideo);
@@ -84,6 +85,8 @@ static void test_query_interface(void)
RELEASE_EXPECT(pMediaPosition, 1);
QI_SUCCEED(pVideoRenderer, IID_IVideoWindow, pVideoWindow);
RELEASE_EXPECT(pVideoWindow, 1);
+
+ RELEASE_EXPECT(pVideoRenderer, 0);
}
static void test_pin(IPin *pin)
@@ -104,18 +107,28 @@ static void test_pin(IPin *pin)
static void test_basefilter(void)
{
+ IUnknown *pVideoRenderer = NULL;
IEnumPins *pin_enum = NULL;
IBaseFilter *base = NULL;
IPin *pins[2];
ULONG ref;
HRESULT hr;
+ hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (LPVOID*)&pVideoRenderer);
+ ok(hr != S_OK || pVideoRenderer != NULL, "CoCreateInstance returned S_OK, but pVideoRenderer is NULL.\n");
+ if (hr != S_OK || !pVideoRenderer)
+ {
+ skip("VideoRenderer is not available, skipping BaseFilter test.\n");
+ return;
+ }
+
IUnknown_QueryInterface(pVideoRenderer, &IID_IBaseFilter, (void **)&base);
if (base == NULL)
{
/* test_query_interface handles this case */
skip("No IBaseFilter\n");
- return;
+ goto out;
}
hr = IBaseFilter_EnumPins(base, NULL);
@@ -147,19 +160,239 @@ static void test_basefilter(void)
ref = IEnumPins_Release(pin_enum);
ok(ref == 0, "ref is %u and not 0!\n", ref);
- IBaseFilter_Release(base);
+out:
+ if (base) IBaseFilter_Release(base);
+ RELEASE_EXPECT(pVideoRenderer, 0);
+}
+
+static void test_monitorconfig7(void)
+{
+ HRESULT hr;
+ IUnknown *pVMR7 = NULL;
+ IVMRMonitorConfig *pMonitorConfig = NULL;
+ VMRGUID guid;
+ VMRMONITORINFO info[8];
+ DWORD numdev_total, numdev;
+ GUID max_guid;
+ RECT max_rect;
+
+ hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (LPVOID*)&pVMR7);
+ ok(hr != S_OK || pVMR7 != NULL, "CoCreateInstance returned S_OK, but pVMR7 is NULL.\n");
+ if (hr != S_OK || !pVMR7)
+ {
+ skip("VideoMixingRenderer7 is not available, skipping MonitorConfig7 test.\n");
+ return;
+ }
+
+ hr = IUnknown_QueryInterface(pVMR7, &IID_IVMRMonitorConfig, (LPVOID*)&pMonitorConfig);
+ ok(hr == S_OK, "IUnknown_QueryInterface returned %x.\n", hr);
+ ok(pMonitorConfig != NULL, "pMonitorConfig is NULL.\n");
+ if (!pMonitorConfig) goto out;
+
+ hr = IVMRMonitorConfig_SetMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "SetMonitor returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig_GetMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "GetMonitor returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig_SetDefaultMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "SetDefaultMonitor returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig_GetDefaultMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "GetDefaultMonitor returned %x, expected E_POINTER.\n", hr);
+
+ memset(&guid, 0, sizeof(guid));
+ guid.pGUID = NULL; /* default DirectDraw device */
+ hr = IVMRMonitorConfig_SetMonitor(pMonitorConfig, &guid);
+ ok(hr == S_OK, "SetMonitor failed with %x.\n", hr);
+
+ memset(&guid, 255, sizeof(guid));
+ hr = IVMRMonitorConfig_GetMonitor(pMonitorConfig, &guid);
+ ok(hr == S_OK, "GetMonitor failed with %x.\n", hr);
+ ok(guid.pGUID == NULL, "GetMonitor returned guid.pGUID = %p, expected NULL.\n", guid.pGUID);
+
+ memset(&guid, 0, sizeof(guid));
+ guid.pGUID = NULL; /* default DirectDraw device */
+ hr = IVMRMonitorConfig_SetDefaultMonitor(pMonitorConfig, &guid);
+ ok(hr == S_OK, "SetDefaultMonitor failed with %x.\n", hr);
+
+ memset(&guid, 255, sizeof(guid));
+ hr = IVMRMonitorConfig_GetDefaultMonitor(pMonitorConfig, &guid);
+ ok(hr == S_OK, "GetDefaultMonitor failed with %x.\n", hr);
+ ok(guid.pGUID == NULL, "GetDefaultMonitor returned guid.pGUID = %p, expected NULL.\n", guid.pGUID);
+
+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, NULL, 0, NULL);
+ ok(hr == E_POINTER, "GetAvailableMonitors returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, 0, &numdev_total);
+ ok(hr == E_INVALIDARG, "GetAvailableMonitors returned %x, expected E_INVALIDARG.\n", hr);
+
+ numdev_total = 0;
+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, NULL, 0, &numdev_total);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev_total > 0, "GetAvailableMonitors returned numdev_total = %d, expected > 0.\n", numdev_total);
+
+ /* check if its possible to provide a buffer which is too small for all entries */
+ if (numdev_total > 1)
+ {
+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, 1, &numdev);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev == 1, "GetAvailableMonitors returned numdev = %d, expected 1.\n", numdev);
+ }
+
+ /* don't request information for more monitors than memory available */
+ if (numdev_total > sizeof(info)/sizeof(info[0]))
+ numdev_total = sizeof(info)/sizeof(info[0]);
+ memset(info, 255, sizeof(info));
+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, numdev_total, &numdev);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev == numdev_total, "GetAvailableMonitors returned numdev = %d, expected %d.\n", numdev, numdev_total);
+
+ memset(&max_guid, 255, sizeof(max_guid));
+ memset(&max_rect, 255, sizeof(max_rect));
+
+ /* check that result is filled out, we do not check if the values actually make any sense */
+ while (numdev--)
+ {
+ ok(info[numdev].guid.pGUID == NULL || info[numdev].guid.pGUID == &info[numdev].guid.GUID,
+ "GetAvailableMonitors returned info[%d].guid.pGUID = %p, expected NULL or %p.\n", numdev, info[numdev].guid.pGUID, &info[numdev].guid.GUID);
+ ok(info[numdev].guid.pGUID != &info[numdev].guid.GUID || memcmp(&info[numdev].guid.GUID, &max_guid, sizeof(max_guid)) != 0,
+ "GetAvailableMonitors returned info[%d].GUID = {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}, expected any other value.\n", numdev);
+ ok(memcmp(&info[numdev].rcMonitor, &max_rect, sizeof(max_rect)) != 0,
+ "GetAvailableMonitors returned info[%d].rcMonitor = {-1, -1, -1, -1}, expected any other value.\n", numdev);
+ ok(info[numdev].hMon != (HMONITOR)0 && info[numdev].hMon != (HMONITOR)-1,
+ "GetAvailableMonitors returned info[%d].hMon = %p, expected != 0 and != -1.\n", numdev, info[numdev].hMon);
+ ok(info[numdev].dwFlags != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwFlags = -1, expected != -1.\n", numdev);
+ ok(memchrW(info[numdev].szDevice, 0, sizeof(info[numdev].szDevice)/sizeof(WCHAR)) != NULL,
+ "GetAvailableMonitors returned info[%d].szDevice without null-termination.\n", numdev);
+ ok(memchrW(info[numdev].szDescription, 0, sizeof(info[numdev].szDescription)/sizeof(WCHAR)) != NULL,
+ "GetAvailableMonitors returned info[%d].szDescription without null-termination.\n", numdev);
+ }
+
+out:
+ if (pMonitorConfig) IVMRMonitorConfig_Release(pMonitorConfig);
+ RELEASE_EXPECT(pVMR7, 0);
+}
+
+static void test_monitorconfig9(void)
+{
+ HRESULT hr;
+ IUnknown *pVMR9 = NULL;
+ IVMRMonitorConfig9 *pMonitorConfig = NULL;
+ UINT uDev;
+ VMR9MonitorInfo info[8];
+ DWORD numdev_total, numdev;
+ RECT max_rect;
+
+ hr = CoCreateInstance(&CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (LPVOID*)&pVMR9);
+ ok(hr != S_OK || pVMR9 != NULL, "CoCreateInstance returned S_OK, but pVMR9 is NULL.\n");
+ if (hr != S_OK || !pVMR9)
+ {
+ skip("VideoMixingRenderer9 is not available, skipping MonitorConfig9 test.\n");
+ return;
+ }
+
+ hr = IUnknown_QueryInterface(pVMR9, &IID_IVMRMonitorConfig9, (LPVOID*)&pMonitorConfig);
+ ok(hr == S_OK, "IUnknown_QueryInterface returned %x.\n", hr);
+ ok(pMonitorConfig != NULL, "pMonitorConfig is NULL.\n");
+ if (!pMonitorConfig) goto out;
+
+ hr = IVMRMonitorConfig9_GetMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "GetMonitor returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig9_GetDefaultMonitor(pMonitorConfig, NULL);
+ ok(hr == E_POINTER, "GetDefaultMonitor returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig9_SetMonitor(pMonitorConfig, 0);
+ ok(hr == S_OK, "SetMonitor failed with %x.\n", hr);
+
+ uDev = 0xdeadbeef;
+ hr = IVMRMonitorConfig9_GetMonitor(pMonitorConfig, &uDev);
+ ok(hr == S_OK, "GetMonitor failed with %x.\n", hr);
+ ok(uDev == 0, "GetMonitor returned uDev = %d, expected 0.\n", uDev);
+
+ hr = IVMRMonitorConfig9_SetDefaultMonitor(pMonitorConfig, 0);
+ ok(hr == S_OK, "SetDefaultMonitor failed with %x.\n", hr);
+
+ uDev = 0xdeadbeef;
+ hr = IVMRMonitorConfig9_GetDefaultMonitor(pMonitorConfig, &uDev);
+ ok(hr == S_OK, "GetDefaultMonitor failed with %x.\n", hr);
+ ok(uDev == 0, "GetDefaultMonitor returned uDev = %d, expected 0.\n", uDev);
+
+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, NULL, 0, NULL);
+ ok(hr == E_POINTER, "GetAvailableMonitors returned %x, expected E_POINTER.\n", hr);
+
+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, 0, &numdev_total);
+ ok(hr == E_INVALIDARG, "GetAvailableMonitors returned %x, expected E_INVALIDARG.\n", hr);
+
+ numdev_total = 0;
+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, NULL, 0, &numdev_total);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev_total > 0, "GetAvailableMonitors returned numdev_total = %d, expected > 0.\n", numdev_total);
+
+ /* check if its possible to provide a buffer which is too small for all entries */
+ if (numdev_total > 1)
+ {
+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, 1, &numdev);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev == 1, "GetAvailableMonitors returned numdev = %d, expected 1.\n", numdev);
+ }
+
+ if (numdev_total > sizeof(info)/sizeof(info[0]))
+ numdev_total = sizeof(info)/sizeof(info[0]);
+ memset(info, 255, sizeof(info));
+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, numdev_total, &numdev);
+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr);
+ ok(numdev == numdev_total, "GetAvailableMonitors returned numdev = %d, expected %d.\n", numdev, numdev_total);
+
+ memset(&max_rect, 255, sizeof(max_rect));
+
+ /* check that result is filled out, we do not check if the values actually make any sense */
+ while (numdev--)
+ {
+ ok(info[numdev].uDevID != (UINT)-1,
+ "GetAvailableMonitors returned info[%d].uDevID = -1, expected != -1.\n", numdev);
+ ok(memcmp(&info[numdev].rcMonitor, &max_rect, sizeof(max_rect)) != 0,
+ "GetAvailableMonitors returned info[%d].rcMonitor = {-1, -1, -1, -1}, expected any other value.\n", numdev);
+ ok(info[numdev].hMon != (HMONITOR)0 && info[numdev].hMon != (HMONITOR)-1,
+ "GetAvailableMonitors returned info[%d].hMon = %p, expected != 0 and != -1.\n", numdev, info[numdev].hMon);
+ ok(info[numdev].dwFlags != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwFlags = -1, expected != -1.\n", numdev);
+ ok(memchrW(info[numdev].szDevice, 0, sizeof(info[numdev].szDevice)/sizeof(WCHAR)) != NULL,
+ "GetAvailableMonitors returned info[%d].szDevice without null-termination.\n", numdev);
+ ok(memchrW(info[numdev].szDescription, 0, sizeof(info[numdev].szDescription)/sizeof(WCHAR)) != NULL,
+ "GetAvailableMonitors returned info[%d].szDescription without null-termination.\n", numdev);
+ ok(info[numdev].dwVendorId != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwVendorId = -1, expected != -1.\n", numdev);
+ ok(info[numdev].dwDeviceId != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwDeviceId = -1, expected != -1.\n", numdev);
+ ok(info[numdev].dwSubSysId != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwSubSysId = -1, expected != -1.\n", numdev);
+ ok(info[numdev].dwRevision != (DWORD)-1,
+ "GetAvailableMonitors returned info[%d].dwRevision = -1, expected != -1.\n", numdev);
+ }
+
+out:
+ if (pMonitorConfig) IVMRMonitorConfig9_Release(pMonitorConfig);
+ RELEASE_EXPECT(pVMR9, 0);
}
START_TEST(videorenderer)
{
CoInitialize(NULL);
- if (!create_video_renderer())
- return;
+ /* Video Renderer tests */
test_query_interface();
test_basefilter();
- release_video_renderer();
+ /* Video Mixing Renderer 7 tests */
+ test_monitorconfig7();
+
+ /* Video Mixing Renderer 9 tests */
+ test_monitorconfig9();
CoUninitialize();
}
--
1.7.9.5

View File

@ -1,4 +0,0 @@
Revision: 1
Author: Sebastian Lackner
Title: Add tests for IVMRMonitorConfig.

View File

@ -6,7 +6,7 @@ diff --git a/libs/wine/config.c b/libs/wine/config.c
index a273502..5fa0cd5 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -478,6 +478,43 @@ const char *wine_get_version(void)
@@ -478,6 +478,42 @@ const char *wine_get_version(void)
return PACKAGE_VERSION;
}
@ -36,7 +36,6 @@ index a273502..5fa0cd5 100644
+ { "325645ba-d39d-4de4-9c94-3fe694eedaab:1", "Sebastian Lackner", "kernel32: Silence repeated CompareStringEx FIXME." },
+ { "acff3012-0f75-4710-9941-08b5ce4c61f3:2", "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME." },
+ { "c7263660-be78-439b-979f-e745a8d87120:1", "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME." },
+ { "eec5dea8-879d-417b-9f97-364deaae6576:1", "Sebastian Lackner", "Add tests for IVMRMonitorConfig." },
+ { "e46b26df-3c1b-419c-9579-f0d1e1c50bea:1", "Sebastian Lackner", "Workaround for broken implementation of shlwapi url functions." },
+ { NULL, NULL, NULL }
+};