Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index af023a10d8..7de9d4abfe 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -4848,6 +4848,38 @@ static void test_dc_target(void) clr = GetPixel(hdc2, 10, 0); ok(clr == 0, "Got color %#x\n", clr);
+ /* Invalid DC. */ + hr = ID2D1DCRenderTarget_BindDC(rt, (HDC)0xdeadbeef, &rect); +todo_wine + ok(hr == E_INVALIDARG, "BindDC() returned %#x.\n", hr); + + ID2D1DCRenderTarget_BeginDraw(rt); + + set_color(&color, 1.0f, 0.0f, 0.0f, 1.0f); + ID2D1DCRenderTarget_Clear(rt, &color); + + hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr); + + clr = GetPixel(hdc2, 0, 0); +todo_wine + ok(clr == RGB(255, 0, 0), "Got color %#x\n", clr); + + hr = ID2D1DCRenderTarget_BindDC(rt, NULL, &rect); + ok(hr == E_INVALIDARG, "BindDC() returned %#x.\n", hr); + + ID2D1DCRenderTarget_BeginDraw(rt); + + set_color(&color, 0.0f, 0.0f, 1.0f, 1.0f); + ID2D1DCRenderTarget_Clear(rt, &color); + + hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "EndDraw() failed, hr %#x.\n", hr); + + clr = GetPixel(hdc2, 0, 0); +todo_wine + ok(clr == RGB(0, 0, 255), "Got color %#x\n", clr); + DeleteDC(hdc); DeleteDC(hdc2); ID2D1DCRenderTarget_Release(rt);
On 15 December 2017 at 16:35, Nikolay Sivov nsivov@codeweavers.com wrote:
+todo_wine
- ok(clr == RGB(255, 0, 0), "Got color %#x\n", clr);
I think %#x is not ideal for colours.