d3d9/tests: Don't test functions directly when reporting GetLastError().

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
André Hentschel 2021-01-06 21:18:26 +01:00 committed by Alexandre Julliard
parent 4ac05afd39
commit f6bb6e987a
1 changed files with 11 additions and 6 deletions

View File

@ -14159,8 +14159,8 @@ static void test_multi_adapter(void)
ok(!!monitor, "Adapter %u: Failed to get monitor.\n", i);
monitor_info.cbSize = sizeof(monitor_info);
ok(GetMonitorInfoA(monitor, (MONITORINFO *)&monitor_info),
"Adapter %u: Failed to get monitor info, error %#x.\n", i, GetLastError());
ret = GetMonitorInfoA(monitor, (MONITORINFO *)&monitor_info);
ok(ret, "Adapter %u: Failed to get monitor info, error %#x.\n", i, GetLastError());
if (!i)
ok(monitor_info.dwFlags == MONITORINFOF_PRIMARY,
@ -14351,6 +14351,7 @@ static void test_cursor_clipping(void)
IDirect3D9 *d3d;
HWND window;
HRESULT hr;
BOOL ret;
window = create_window();
ok(!!window, "Failed to create a window.\n");
@ -14377,10 +14378,12 @@ static void test_cursor_clipping(void)
"Adapter %u: Failed to find a different mode than %ux%u.\n", adapter_idx,
current_mode.Width, current_mode.Height);
ok(ClipCursor(NULL), "Adapter %u: ClipCursor failed, error %#x.\n", adapter_idx,
ret = ClipCursor(NULL);
ok(ret, "Adapter %u: ClipCursor failed, error %#x.\n", adapter_idx,
GetLastError());
get_virtual_rect(&virtual_rect);
ok(GetClipCursor(&clip_rect), "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
ret = GetClipCursor(&clip_rect);
ok(ret, "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
GetLastError());
ok(EqualRect(&clip_rect, &virtual_rect), "Adapter %u: Expect clip rect %s, got %s.\n",
adapter_idx, wine_dbgstr_rect(&virtual_rect), wine_dbgstr_rect(&clip_rect));
@ -14395,7 +14398,8 @@ static void test_cursor_clipping(void)
}
flush_events();
get_virtual_rect(&virtual_rect);
ok(GetClipCursor(&clip_rect), "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
ret = GetClipCursor(&clip_rect);
ok(ret, "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
GetLastError());
ok(EqualRect(&clip_rect, &virtual_rect), "Adapter %u: Expect clip rect %s, got %s.\n",
adapter_idx, wine_dbgstr_rect(&virtual_rect), wine_dbgstr_rect(&clip_rect));
@ -14403,7 +14407,8 @@ static void test_cursor_clipping(void)
IDirect3DDevice9_Release(device);
flush_events();
get_virtual_rect(&virtual_rect);
ok(GetClipCursor(&clip_rect), "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
ret = GetClipCursor(&clip_rect);
ok(ret, "Adapter %u: GetClipCursor failed, error %#x.\n", adapter_idx,
GetLastError());
ok(EqualRect(&clip_rect, &virtual_rect), "Adapter %u: Expect clip rect %s, got %s.\n",
adapter_idx, wine_dbgstr_rect(&virtual_rect), wine_dbgstr_rect(&clip_rect));