From: Zhiyi Zhang <zzhang@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 6ae1f65a24b..86832aae5da 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -17793,6 +17793,37 @@ static void test_glyph_run_world_bounds(BOOL d3d11) release_test_context(&ctx); } +static void test_begin_end_draw(BOOL d3d11) +{ + struct d2d1_test_context ctx; + ID2D1DeviceContext *context; + HRESULT hr; + + if (!init_test_context(&ctx, d3d11)) + return; + + context = ctx.context; + + /* EndDraw() without BeginDraw() */ + hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL); + todo_wine + ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr); + + /* BeginDraw() twice */ + ID2D1DeviceContext_BeginDraw(context); + ID2D1DeviceContext_BeginDraw(context); + hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL); + todo_wine + ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#lx.\n", hr); + + /* Normal */ + ID2D1DeviceContext_BeginDraw(context); + hr = ID2D1DeviceContext_EndDraw(context, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + release_test_context(&ctx); +} + START_TEST(d2d1) { HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll"); @@ -17916,6 +17947,7 @@ START_TEST(d2d1) queue_d3d10_test(test_path_geometry_stream); queue_d3d10_test(test_transformed_geometry); queue_d3d10_test(test_glyph_run_world_bounds); + queue_test(test_begin_end_draw); run_queued_tests(); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9961