gdi32/tests: Print GetLastError() in decimal with '%u'.

This commit is contained in:
Francois Gouget 2007-01-05 21:49:04 +01:00 committed by Alexandre Julliard
parent 947b71aeb0
commit 51ab5c33c8
1 changed files with 19 additions and 19 deletions

View File

@ -44,55 +44,55 @@ static void test_gdi_objects(void)
SetLastError(0);
hp = SelectObject(NULL, GetStockObject(BLACK_PEN));
ok(!hp && GetLastError() == ERROR_INVALID_HANDLE,
"SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, 0x%08x\n",
"SelectObject(NULL DC) expected 0, ERROR_INVALID_HANDLE, got %p, %u\n",
hp, GetLastError());
/* With a valid DC and a NULL object, the call returns 0 but does not SetLastError() */
SetLastError(0);
hp = SelectObject(hdc, NULL);
ok(!hp && !GetLastError(),
"SelectObject(NULL obj) expected 0, NO_ERROR, got %p, 0x%08x\n",
"SelectObject(NULL obj) expected 0, NO_ERROR, got %p, %u\n",
hp, GetLastError());
/* The DC is unaffected by the NULL SelectObject */
SetLastError(0);
hp = SelectObject(hdc, GetStockObject(BLACK_PEN));
ok(hp && !GetLastError(),
"SelectObject(post NULL) expected non-null, NO_ERROR, got %p, 0x%08x\n",
"SelectObject(post NULL) expected non-null, NO_ERROR, got %p, %u\n",
hp, GetLastError());
/* GetCurrentObject does not SetLastError() on a null object */
SetLastError(0);
hp = GetCurrentObject(NULL, OBJ_PEN);
ok(!hp && !GetLastError(),
"GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, 0x%08x\n",
"GetCurrentObject(NULL DC) expected 0, NO_ERROR, got %p, %u\n",
hp, GetLastError());
/* DeleteObject does not SetLastError() on a null object */
ret = DeleteObject(NULL);
ok( !ret && !GetLastError(),
"DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, 0x%08x\n",
"DeleteObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
ret, GetLastError());
/* GetObject does not SetLastError() on a null object */
SetLastError(0);
i = GetObjectA(NULL, sizeof(buff), buff);
ok (!i && !GetLastError(),
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, 0x%08x\n",
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
i, GetLastError());
/* GetObjectType does SetLastError() on a null object */
SetLastError(0);
i = GetObjectType(NULL);
ok (!i && GetLastError() == ERROR_INVALID_HANDLE,
"GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, 0x%08x\n",
"GetObjectType(NULL obj), expected 0, ERROR_INVALID_HANDLE, got %d, %u\n",
i, GetLastError());
/* UnrealizeObject does not SetLastError() on a null object */
SetLastError(0);
i = UnrealizeObject(NULL);
ok (!i && !GetLastError(),
"UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, 0x%08x\n",
"UnrealizeObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
i, GetLastError());
ReleaseDC(NULL, hdc);
@ -113,7 +113,7 @@ static DWORD WINAPI thread_proc(void *param)
struct hgdiobj_event *hgdiobj_event = (struct hgdiobj_event *)param;
hgdiobj_event->hdc = CreateDC("display", NULL, NULL, NULL);
ok(hgdiobj_event->hdc != NULL, "CreateDC error %d\n", GetLastError());
ok(hgdiobj_event->hdc != NULL, "CreateDC error %u\n", GetLastError());
hgdiobj_event->hgdiobj1 = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3));
ok(hgdiobj_event->hgdiobj1 != 0, "Failed to create pen\n");
@ -123,7 +123,7 @@ static DWORD WINAPI thread_proc(void *param)
SetEvent(hgdiobj_event->ready_event);
ok(WaitForSingleObject(hgdiobj_event->stop_event, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %d\n", GetLastError());
"WaitForSingleObject error %u\n", GetLastError());
ok(!GetObject(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n");
@ -141,18 +141,18 @@ static void test_thread_objects(void)
INT ret;
hgdiobj_event.stop_event = CreateEvent(NULL, 0, 0, NULL);
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %d\n", GetLastError());
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError());
hgdiobj_event.ready_event = CreateEvent(NULL, 0, 0, NULL);
ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %d\n", GetLastError());
ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %u\n", GetLastError());
hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid);
ok(hthread != NULL, "CreateThread error %d\n", GetLastError());
ok(hthread != NULL, "CreateThread error %u\n", GetLastError());
ok(WaitForSingleObject(hgdiobj_event.ready_event, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %d\n", GetLastError());
"WaitForSingleObject error %u\n", GetLastError());
ok(GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp) == sizeof(lp),
"GetObject error %d\n", GetLastError());
"GetObject error %u\n", GetLastError());
ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle);
ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y);
@ -161,20 +161,20 @@ static void test_thread_objects(void)
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);
ok(DeleteObject(hgdiobj_event.hgdiobj1), "DeleteObject error %d\n", GetLastError());
ok(DeleteDC(hgdiobj_event.hdc), "DeleteDC error %d\n", GetLastError());
ok(DeleteObject(hgdiobj_event.hgdiobj1), "DeleteObject error %u\n", GetLastError());
ok(DeleteDC(hgdiobj_event.hdc), "DeleteDC error %u\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
SetEvent(hgdiobj_event.stop_event);
ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %d\n", GetLastError());
"WaitForSingleObject error %u\n", GetLastError());
CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
ok(DeleteObject(hgdiobj_event.hgdiobj2), "DeleteObject error %d\n", GetLastError());
ok(DeleteObject(hgdiobj_event.hgdiobj2), "DeleteObject error %u\n", GetLastError());
CloseHandle(hgdiobj_event.stop_event);
CloseHandle(hgdiobj_event.ready_event);