Module: wine Branch: master Commit: 3f304014952636e6ee78c2f7495ee6fb60604d0b URL: https://gitlab.winehq.org/wine/wine/-/commit/3f304014952636e6ee78c2f7495ee6f...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sat Oct 7 18:11:41 2023 +0200
gdi32/tests: Add some tests for SetMiterLimit() argument validation.
---
dlls/gdi32/tests/dc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index e3d29ae9ca9..d8204acfc14 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -38,6 +38,8 @@ static void test_dc_values(void) HDC hdc = CreateDCA("DISPLAY", NULL, NULL, NULL); COLORREF color; int extra, attr; + float limit; + BOOL ret;
ok( hdc != NULL, "CreateDC failed\n" ); color = SetBkColor( hdc, 0x12345678 ); @@ -91,6 +93,25 @@ static void test_dc_values(void) ok(!attr, "GetDeviceCaps rets %d\n", attr); ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %lu\n", GetLastError());
+ /* Miter limit */ + limit = 123.0f; + ret = GetMiterLimit(hdc, &limit); + ok(ret, "Unexpected return value.\n"); + ok(limit == 10.0f, "Unexpected default miter limit %f.\n", limit); + + limit = 456.0; + ret = SetMiterLimit(hdc, 0.9f, &limit); + todo_wine + ok(!ret, "Unexpected return value.\n"); + todo_wine + ok(limit == 456.0f, "Unexpected default miter limit %f.\n", limit); + + limit = 0.0; + ret = SetMiterLimit(hdc, 1.0f, &limit); + ok(ret, "Unexpected return value.\n"); + todo_wine + ok(limit == 10.0f, "Unexpected default miter limit %f.\n", limit); + DeleteDC( hdc ); }