Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/d3drm/tests/d3drm.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 3beeaee007..9811224f46 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -1733,6 +1733,7 @@ static void test_Viewport(void) DWORD data, ref1, ref2, ref3, ref4; DWORD initial_ref1, initial_ref2, initial_ref3, device_ref, frame_ref, frame_ref2, viewport_ref;
+ /* Set up */ window = create_window(); GetClientRect(window, &rc);
@@ -1769,6 +1770,7 @@ static void test_Viewport(void) device_ref = get_refcount((IUnknown *)device1); frame_ref = get_refcount((IUnknown *)frame);
+ /* IDirect3DRM::CreateViewport tests */ hr = IDirect3DRM_CreateViewport(d3drm1, device1, frame, 0, 0, 0, 0, &viewport); ok(SUCCEEDED(hr), "Cannot get IDirect3DRMViewport interface (hr = %#x)\n", hr); ref4 = get_refcount((IUnknown *)d3drm1); @@ -1799,6 +1801,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame); ok(ref4 == frame_ref, "Expected ref4 == frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
+ /* IDirect3DRM2::CreateViewport tests */ hr = IDirect3DRM2_CreateViewport(d3drm2, device1, frame, 0, 0, 0, 0, &viewport); ok(SUCCEEDED(hr), "Cannot get IDirect3DRMViewport interface (hr = %#x)\n", hr); ref4 = get_refcount((IUnknown *)d3drm1); @@ -1832,6 +1835,7 @@ static void test_Viewport(void) device_ref = get_refcount((IUnknown *)device3); frame_ref2 = get_refcount((IUnknown *)frame3);
+ /* IDirect3DRM3::CreateViewport tests */ hr = IDirect3DRM3_CreateViewport(d3drm3, device3, frame3, 0, 0, 0, 0, &viewport2); ok(SUCCEEDED(hr), "Cannot get IDirect3DRMViewport2 interface (hr = %#x)\n", hr); ref4 = get_refcount((IUnknown *)d3drm1); @@ -1862,7 +1866,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame3); ok(ref4 == frame_ref2, "Expected ref4 == frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
- /* Test all failures together */ + /* IDirect3DRM::CreateViewport failure tests */ viewport = (IDirect3DRMViewport *)0xdeadbeef; hr = IDirect3DRM_CreateViewport(d3drm1, NULL, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); @@ -1886,6 +1890,7 @@ static void test_Viewport(void) hr = IDirect3DRM_CreateViewport(d3drm1, device1, frame, rc.left, rc.top, rc.right, rc.bottom, NULL); ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
+ /* IDirect3DRM2::CreateViewport failure tests */ viewport = (IDirect3DRMViewport *)0xdeadbeef; hr = IDirect3DRM2_CreateViewport(d3drm2, NULL, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); @@ -1909,6 +1914,7 @@ static void test_Viewport(void) hr = IDirect3DRM2_CreateViewport(d3drm2, device1, frame, rc.left, rc.top, rc.right, rc.bottom, NULL); ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
+ /* IDirect3DRM3::CreateViewport failure tests */ viewport2 = (IDirect3DRMViewport2 *)0xdeadbeef; hr = IDirect3DRM3_CreateViewport(d3drm3, NULL, frame3, rc.left, rc.top, rc.right, rc.bottom, &viewport2); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); @@ -1932,6 +1938,7 @@ static void test_Viewport(void) hr = IDirect3DRM3_CreateViewport(d3drm3, device3, frame3, rc.left, rc.top, rc.right, rc.bottom, NULL); ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
+ /* [IDirect3DRM2] IDirect3DRMViewport::GetDirect3DViewport tests */ hr = IDirect3DRM2_CreateViewport(d3drm2, device1, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %#x)\n", hr); hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport); @@ -1965,6 +1972,7 @@ static void test_Viewport(void) IDirect3DViewport_Release(d3d_viewport); IDirect3DRMViewport_Release(viewport);
+ /* [IDirect3DRM3] IDirect3DRMViewport2::GetDirect3DViewport tests */ hr = IDirect3DRM3_CreateViewport(d3drm3, device3, frame3, rc.left, rc.top, rc.right, rc.bottom, &viewport2); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport2 interface (hr = %#x)\n", hr); hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport); @@ -1998,6 +2006,7 @@ static void test_Viewport(void) IDirect3DViewport_Release(d3d_viewport); IDirect3DRMViewport2_Release(viewport2);
+ /* [IDirect3DRM] IDirect3DRMViewport::GetDirect3DViewport tests */ hr = IDirect3DRM_CreateViewport(d3drm1, device1, frame, rc.left, rc.top, rc.right, rc.bottom, &viewport); ok(hr == D3DRM_OK, "Cannot get IDirect3DRMViewport interface (hr = %x)\n", hr); hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport); @@ -2030,6 +2039,7 @@ static void test_Viewport(void) ok(vp.dvMaxY == expected_val, "Expected dvMaxY = %f, got %f.\n", expected_val, vp.dvMaxY); IDirect3DViewport_Release(d3d_viewport);
+ /* IDirect3DRMViewport*::QueryInterface tests */ hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMObject, (void**)&obj); ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); ok((IDirect3DRMObject*)viewport == obj, "got object pointer %p, expected %p\n", obj, viewport); @@ -2070,7 +2080,7 @@ static void test_Viewport(void) IDirect3DRMViewport2_Release(viewport2); IDirect3DRMViewport_Release(viewport);
- /* IDirect3DRMViewport*::Init tests */ + /* IDirect3DRMViewport::Init tests ... */ ref1 = get_refcount((IUnknown *)d3drm1); ref2 = get_refcount((IUnknown *)d3drm2); ref3 = get_refcount((IUnknown *)d3drm3); @@ -2084,12 +2094,13 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)d3drm3); ok(ref4 == ref3, "Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
+ /* ... test pre-Init return values */ hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, &d3d_viewport); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport_GetDevice(viewport, &d3drm_device1); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
- /* Test all failures together */ + /* ... test Init failure */ hr = IDirect3DRMViewport_Init(viewport, NULL, frame, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport_Init(viewport, device1, NULL, rc.left, rc.top, rc.right, rc.bottom); @@ -2101,6 +2112,7 @@ static void test_Viewport(void) hr = IDirect3DRMViewport_Init(viewport, device1, frame, rc.left, rc.top, rc.right, rc.bottom + 1); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
+ /* ... test Init success */ device_ref = get_refcount((IUnknown *)device1); frame_ref = get_refcount((IUnknown *)frame); hr = IDirect3DRMViewport_Init(viewport, device1, frame, rc.left, rc.top, rc.right, rc.bottom); @@ -2116,6 +2128,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame); ok(ref4 > frame_ref, "Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
+ /* ... test initialized values */ hr = IDirect3DRMViewport_GetDevice(viewport, &d3drm_device1); ok(SUCCEEDED(hr), "Cannot get IDirect3DRMDevice3 interface (hr = %x)\n", hr); ok(device1 == d3drm_device1, "Expected device returned = %p, got %p.\n", device3, d3drm_device3); @@ -2151,6 +2164,7 @@ static void test_Viewport(void) ok(vp.dvMaxY == expected_val, "Expected dvMaxY = %f, got %f.\n", expected_val, vp.dvMaxY); IDirect3DViewport_Release(d3d_viewport);
+ /* ... test post-Init failures */ hr = IDirect3DRMViewport_Init(viewport, device1, frame, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport_GetDevice(viewport, NULL); @@ -2174,6 +2188,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame); todo_wine ok(ref4 > frame_ref, "Expected ref4 > frame_ref, got frame_ref = %u, ref4 = %u.\n", frame_ref, ref4);
+ /* IDirect3DRMViewport2::Init tests ... */ ref1 = get_refcount((IUnknown *)d3drm1); ref2 = get_refcount((IUnknown *)d3drm2); ref3 = get_refcount((IUnknown *)d3drm3); @@ -2187,11 +2202,13 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)d3drm3); ok(ref4 == ref3, "Expected ref4 == ref3, got ref3 = %u, ref4 = %u.\n", ref3, ref4);
+ /* ... test pre-Init return values */ hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport2_GetDevice(viewport2, &d3drm_device3); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
+ /* ... test Init failure */ hr = IDirect3DRMViewport2_Init(viewport2, NULL, frame3, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport2_Init(viewport2, device3, NULL, rc.left, rc.top, rc.right, rc.bottom); @@ -2203,6 +2220,7 @@ static void test_Viewport(void) hr = IDirect3DRMViewport2_Init(viewport2, device3, frame3, rc.left, rc.top, rc.right, rc.bottom + 1); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
+ /* ... test Init success */ device_ref = get_refcount((IUnknown *)device3); frame_ref2 = get_refcount((IUnknown *)frame3); hr = IDirect3DRMViewport2_Init(viewport2, device3, frame3, rc.left, rc.top, rc.right, rc.bottom); @@ -2212,6 +2230,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame3); ok(ref4 > frame_ref2, "Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
+ /* ... test initialized values */ hr = IDirect3DRMViewport2_GetDevice(viewport2, &d3drm_device3); ok(SUCCEEDED(hr), "Cannot get IDirect3DRMDevice3 interface (hr = %x)\n", hr); ok(device3 == d3drm_device3, "Expected device returned = %p, got %p.\n", device3, d3drm_device3); @@ -2247,6 +2266,7 @@ static void test_Viewport(void) ok(vp.dvMaxY == expected_val, "Expected dvMaxY = %f, got %f.\n", expected_val, vp.dvMaxY); IDirect3DViewport_Release(d3d_viewport);
+ /* ... test post-Init failures */ hr = IDirect3DRMViewport2_Init(viewport2, device3, frame3, rc.left, rc.top, rc.right, rc.bottom); ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); hr = IDirect3DRMViewport2_GetDevice(viewport2, NULL); @@ -2270,6 +2290,7 @@ static void test_Viewport(void) ref4 = get_refcount((IUnknown *)frame3); todo_wine ok(ref4 > frame_ref2, "Expected ref4 > frame_ref2, got frame_ref2 = %u, ref4 = %u.\n", frame_ref2, ref4);
+ /* Clean up */ IDirect3DRMDevice3_Release(device3); IDirect3DRMDevice_Release(device1); ref4 = get_refcount((IUnknown *)d3drm1);