Commit 66ef2f25 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

user/tests: Win64 printf format warning fixes.

parent a76b29e0
......@@ -4,7 +4,6 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = user32.dll
IMPORTS = user32 gdi32 advapi32 kernel32
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
class.c \
......
......@@ -106,9 +106,9 @@ static void ClassTest(HINSTANCE hInstance, BOOL global)
{
SetLastError(0);
ok(!SetClassLongW(hTestWnd,i*sizeof(DWORD),i+1),
"GetClassLongW(%ld) initial value nonzero!\n",i*sizeof(DWORD));
"GetClassLongW(%d) initial value nonzero!\n",i*sizeof(DWORD));
ok(!GetLastError(),
"SetClassLongW(%ld) failed!\n",i*sizeof(DWORD));
"SetClassLongW(%d) failed!\n",i*sizeof(DWORD));
}
/* test values of valid classwords that we set */
......@@ -255,7 +255,7 @@ static void check_instance( const char *name, HINSTANCE inst, HINSTANCE info_ins
"Wrong GWL instance %p/%p for window %s\n",
(HINSTANCE)GetWindowLongPtrA( hwnd, GWLP_HINSTANCE ), inst, name );
ok(!UnregisterClassA(name, inst), "UnregisterClassA should fail while exists a class window\n");
ok(GetLastError() == ERROR_CLASS_HAS_WINDOWS, "GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %ld\n", GetLastError());
ok(GetLastError() == ERROR_CLASS_HAS_WINDOWS, "GetLastError() should be set to ERROR_CLASS_HAS_WINDOWS not %d\n", GetLastError());
DestroyWindow(hwnd);
}
......@@ -286,7 +286,7 @@ static void check_thread_instance( const char *name, HINSTANCE inst, HINSTANCE i
class_info.gcl_inst = gcl_inst;
hThread = CreateThread(NULL, 0, thread_proc, &class_info, 0, &tid);
ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
ok(hThread != NULL, "CreateThread failed, error %d\n", GetLastError());
ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
CloseHandle(hThread);
}
......@@ -425,7 +425,7 @@ static void test_instances(void)
cls.lpszMenuName = "null";
cls.hInstance = 0;
ok( !RegisterClassA( &cls ), "Succeeded registering local class for null instance\n" );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
ok( UnregisterClassA( name, main_module ), "Unregister failed for main module\n" );
ok( RegisterClassA( &cls ), "Failed to register local class for null instance\n" );
......@@ -434,17 +434,17 @@ static void test_instances(void)
check_instance( name, main_module, main_module, main_module );
check_thread_instance( name, main_module, main_module, main_module );
ok( !GetClassInfo( 0, name, &wc ), "Class found with null instance\n" );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
ok( UnregisterClassA( name, 0 ), "Unregister failed for null instance\n" );
/* registering for user32 always fails */
cls.lpszMenuName = "user32";
cls.hInstance = user32;
ok( !RegisterClassA( &cls ), "Succeeded registering local class for user32\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %d\n", GetLastError() );
cls.style |= CS_GLOBALCLASS;
ok( !RegisterClassA( &cls ), "Succeeded registering global class for user32\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "Wrong error code %d\n", GetLastError() );
/* unregister is OK though */
cls.hInstance = main_module;
......@@ -459,12 +459,12 @@ static void test_instances(void)
cls.lpszMenuName = "kernel32";
cls.hInstance = kernel32;
ok( !RegisterClassA( &cls ), "Succeeded registering local class for kernel32\n" );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
/* even if global flag is cleared */
hwnd = CreateWindowExA( 0, name, "test", 0, 0, 0, 0, 0, 0, 0, main_module, 0 );
SetClassLongA( hwnd, GCL_STYLE, 0 );
ok( !RegisterClassA( &cls ), "Succeeded registering local class for kernel32\n" );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
check_class( main_module, name, "main_module" );
check_class( kernel32, name, "main_module" );
......@@ -485,7 +485,7 @@ static void test_instances(void)
DestroyWindow( hwnd );
ok( UnregisterClassA( name, (HINSTANCE)0x87654321 ), "Unregister failed for main module global\n" );
ok( !UnregisterClassA( name, (HINSTANCE)0x87654321 ), "Unregister succeeded the second time\n" );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
cls.hInstance = (HINSTANCE)0x12345678;
ok( RegisterClassA( &cls ), "Failed to register global class for dummy instance\n" );
......@@ -503,10 +503,10 @@ static void test_instances(void)
cls.lpszClassName = "BUTTON";
cls.hInstance = main_module;
ok( !RegisterClassA( &cls ), "Succeeded registering global button class for main module\n" );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
cls.hInstance = kernel32;
ok( !RegisterClassA( &cls ), "Succeeded registering global button class for kernel32\n" );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_ALREADY_EXISTS, "Wrong error code %d\n", GetLastError() );
/* local class is OK however */
cls.style &= ~CS_GLOBALCLASS;
......@@ -534,9 +534,9 @@ static void test_instances(void)
ok( GetClassInfo( kernel32, "BUTTON", &wc ), "Button class not found with kernel32\n" );
ok( UnregisterClass( "BUTTON", (HINSTANCE)0x12345678 ), "Failed to unregister button\n" );
ok( !UnregisterClass( "BUTTON", (HINSTANCE)0x87654321 ), "Unregistered button a second time\n" );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
ok( !GetClassInfo( 0, "BUTTON", &wc ), "Button still exists\n" );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %ld\n", GetLastError() );
ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() );
/* we can change the instance of a system class */
check_instance( "EDIT", (HINSTANCE)0xdeadbeef, (HINSTANCE)0xdeadbeef, user32 );
......
......@@ -30,7 +30,7 @@ static BOOL is_win9x = FALSE;
{ \
if (!is_win9x) \
ok(GetLastError() == expected_error, \
"Last error should be set to %d, not %ld\n", \
"Last error should be set to %d, not %d\n", \
expected_error, GetLastError()); \
} while (0)
......@@ -45,12 +45,12 @@ static void test_ClipboardOwner(void)
hWnd1 = CreateWindowExA(0, "static", NULL, WS_POPUP,
0, 0, 10, 10, 0, 0, 0, NULL);
ok(hWnd1 != 0, "CreateWindowExA error %ld\n", GetLastError());
ok(hWnd1 != 0, "CreateWindowExA error %d\n", GetLastError());
trace("hWnd1 = %p\n", hWnd1);
hWnd2 = CreateWindowExA(0, "static", NULL, WS_POPUP,
0, 0, 10, 10, 0, 0, 0, NULL);
ok(hWnd2 != 0, "CreateWindowExA error %ld\n", GetLastError());
ok(hWnd2 != 0, "CreateWindowExA error %d\n", GetLastError());
trace("hWnd2 = %p\n", hWnd2);
SetLastError(0xdeadbeef);
......@@ -61,7 +61,7 @@ static void test_ClipboardOwner(void)
ok(!GetClipboardOwner(), "clipboard should still be not owned\n");
ok(!OpenClipboard(hWnd1), "OpenClipboard should fail since clipboard already opened\n");
ret = CloseClipboard();
ok( ret, "CloseClipboard error %ld\n", GetLastError());
ok( ret, "CloseClipboard error %d\n", GetLastError());
ok(OpenClipboard(hWnd1), "OpenClipboard failed\n");
......@@ -72,7 +72,7 @@ static void test_ClipboardOwner(void)
SetLastError(0xdeadbeef);
ok(!GetClipboardOwner() && GetLastError() == 0xdeadbeef, "clipboard should still be not owned\n");
ret = EmptyClipboard();
ok( ret, "EmptyClipboard error %ld\n", GetLastError());
ok( ret, "EmptyClipboard error %d\n", GetLastError());
ok(GetClipboardOwner() == hWnd1, "clipboard should be owned by %p, not by %p\n", hWnd1, GetClipboardOwner());
SetLastError(0xdeadbeef);
......@@ -80,13 +80,13 @@ static void test_ClipboardOwner(void)
"OpenClipboard should fail without setting last error value\n");
ret = CloseClipboard();
ok( ret, "CloseClipboard error %ld\n", GetLastError());
ok( ret, "CloseClipboard error %d\n", GetLastError());
ok(GetClipboardOwner() == hWnd1, "clipboard should still be owned\n");
ret = DestroyWindow(hWnd1);
ok( ret, "DestroyWindow error %ld\n", GetLastError());
ok( ret, "DestroyWindow error %d\n", GetLastError());
ret = DestroyWindow(hWnd2);
ok( ret, "DestroyWindow error %ld\n", GetLastError());
ok( ret, "DestroyWindow error %d\n", GetLastError());
SetLastError(0xdeadbeef);
ok(!GetClipboardOwner() && GetLastError() == 0xdeadbeef, "clipboard should not be owned\n");
}
......@@ -157,7 +157,7 @@ todo_wine
#endif
ret = OpenClipboard(0);
ok( ret, "OpenClipboard error %ld\n", GetLastError());
ok( ret, "OpenClipboard error %d\n", GetLastError());
trace("# of formats available: %d\n", CountClipboardFormats());
......@@ -170,16 +170,16 @@ todo_wine
}
ret = EmptyClipboard();
ok( ret, "EmptyClipboard error %ld\n", GetLastError());
ok( ret, "EmptyClipboard error %d\n", GetLastError());
ret =CloseClipboard();
ok( ret, "CloseClipboard error %ld\n", GetLastError());
ok( ret, "CloseClipboard error %d\n", GetLastError());
if (CountClipboardFormats())
{
SetLastError(0xdeadbeef);
ok(!EnumClipboardFormats(0), "EnumClipboardFormats should fail if clipboard wasn't open\n");
ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN,
"Last error should be set to ERROR_CLIPBOARD_NOT_OPEN, not %ld\n", GetLastError());
"Last error should be set to ERROR_CLIPBOARD_NOT_OPEN, not %d\n", GetLastError());
}
SetLastError(0xdeadbeef);
......
......@@ -227,7 +227,7 @@ static void test_dde_transaction(void)
dde_inst = 0;
ret = DdeInitializeA(&dde_inst, client_dde_callback, APPCMD_CLIENTONLY, 0);
ok(ret == DMLERR_NO_ERROR, "DdeInitializeW failed with error %04lx (%x)\n",
ok(ret == DMLERR_NO_ERROR, "DdeInitializeW failed with error %04x (%x)\n",
ret, DdeGetLastError(dde_inst));
hsz_server = DdeCreateStringHandleW(dde_inst, TEST_DDE_SERVICE, CP_WINUNICODE);
......@@ -235,11 +235,11 @@ static void test_dde_transaction(void)
hconv = DdeConnect(dde_inst, hsz_server, 0, NULL);
ok(hconv != 0, "DdeConnect error %x\n", DdeGetLastError(dde_inst));
err = DdeGetLastError(dde_inst);
ok(err == DMLERR_NO_ERROR, "wrong dde error %lx\n", err);
ok(err == DMLERR_NO_ERROR, "wrong dde error %x\n", err);
info.cb = sizeof(info);
ret = DdeQueryConvInfo(hconv, QID_SYNC, &info);
ok(ret, "wrong info size %ld, DdeQueryConvInfo error %x\n", ret, DdeGetLastError(dde_inst));
ok(ret, "wrong info size %d, DdeQueryConvInfo error %x\n", ret, DdeGetLastError(dde_inst));
/* should be CP_WINANSI since we used DdeInitializeA */
ok(info.ConvCtxt.iCodePage == CP_WINANSI, "wrong iCodePage %d\n", info.ConvCtxt.iCodePage);
ok(!info.hConvPartner, "unexpected info.hConvPartner: %p\n", info.hConvPartner);
......@@ -256,26 +256,26 @@ todo_wine {
ret = 0xdeadbeef;
hdata = DdeClientTransaction((LPBYTE)test_cmd, strlen(test_cmd) + 1, hconv, (HSZ)0xdead, 0xbeef, XTYP_EXECUTE, 1000, &ret);
ok(!hdata, "DdeClientTransaction succeeded\n");
ok(ret == DDE_FNOTPROCESSED, "wrong status code %04lx\n", ret);
ok(ret == DDE_FNOTPROCESSED, "wrong status code %04x\n", ret);
err = DdeGetLastError(dde_inst);
ok(err == DMLERR_NOTPROCESSED, "wrong dde error %lx\n", err);
ok(err == DMLERR_NOTPROCESSED, "wrong dde error %x\n", err);
trace("sending ANSI client transaction command\n");
ret = 0xdeadbeef;
hdata = DdeClientTransaction((LPBYTE)exec_cmdA, lstrlenA(exec_cmdA) + 1, hconv, 0, 0, XTYP_EXECUTE, 1000, &ret);
ok(hdata != 0, "DdeClientTransaction returned %p, error %x\n", hdata, DdeGetLastError(dde_inst));
ok(ret == DDE_FACK, "wrong status code %04lx\n", ret);
ok(ret == DDE_FACK, "wrong status code %04x\n", ret);
err = DdeGetLastError(dde_inst);
ok(err == DMLERR_NO_ERROR, "wrong dde error %lx\n", err);
ok(err == DMLERR_NO_ERROR, "wrong dde error %x\n", err);
trace("sending unicode client transaction command\n");
ret = 0xdeadbeef;
hdata = DdeClientTransaction((LPBYTE)exec_cmdW, (lstrlenW(exec_cmdW) + 1) * sizeof(WCHAR), hconv, 0, 0, XTYP_EXECUTE, 1000, &ret);
ok(hdata != 0, "DdeClientTransaction returned %p, error %x\n", hdata, DdeGetLastError(dde_inst));
ok(ret == DDE_FACK, "wrong status code %04lx\n", ret);
ok(ret == DDE_FACK, "wrong status code %04x\n", ret);
err = DdeGetLastError(dde_inst);
ok(err == DMLERR_NO_ERROR, "wrong dde error %lx\n", err);
ok(err == DMLERR_NO_ERROR, "wrong dde error %x\n", err);
ok(DdeDisconnect(hconv), "DdeDisconnect error %x\n", DdeGetLastError(dde_inst));
......@@ -284,7 +284,7 @@ todo_wine {
ok(!ret, "DdeQueryConvInfo should fail\n");
err = DdeGetLastError(dde_inst);
todo_wine {
ok(err == DMLERR_INVALIDPARAMETER, "wrong dde error %lx\n", err);
ok(err == DMLERR_INVALIDPARAMETER, "wrong dde error %x\n", err);
}
ok(DdeFreeStringHandle(dde_inst, hsz_server), "DdeFreeStringHandle error %x\n", DdeGetLastError(dde_inst));
......@@ -366,12 +366,12 @@ static void test_DdeCreateStringHandle(void)
return;
}
ok(ret == DMLERR_INVALIDPARAMETER, "DdeInitializeW should fail, but got %04lx instead\n", ret);
ok(ret == DMLERR_INVALIDPARAMETER, "DdeInitializeW should fail, but got %04x instead\n", ret);
ok(DdeGetLastError(dde_inst) == DMLERR_INVALIDPARAMETER, "expected DMLERR_INVALIDPARAMETER\n");
dde_inst = 0;
ret = DdeInitializeW(&dde_inst, client_dde_callback, APPCMD_CLIENTONLY, 0);
ok(ret == DMLERR_NO_ERROR, "DdeInitializeW failed with error %04lx (%08x)\n",
ok(ret == DMLERR_NO_ERROR, "DdeInitializeW failed with error %04x (%08x)\n",
ret, DdeGetLastError(dde_inst));
test_DdeCreateStringHandleW(dde_inst, 0);
......
......@@ -196,7 +196,7 @@ static BOOL CreateWindows (HINSTANCE hinst)
exstyle = GetWindowLong (hwnd[p->id], GWL_EXSTYLE);
if (style != p->style || exstyle != p->exstyle)
{
trace ("Style mismatch at %d: %8.8lx %8.8lx cf %8.8lx %8.8lx\n", p->id, style, exstyle, p->style, p->exstyle);
trace ("Style mismatch at %d: %8.8x %8.8x cf %8.8x %8.8x\n", p->id, style, exstyle, p->style, p->exstyle);
}
}
p++;
......
......@@ -167,52 +167,52 @@ static void test_edit_control_1(void)
trace("EDIT: Single line\n");
hwEdit = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
r = get_edit_style(hwEdit);
ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%lx\n", r);
ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL), "Wrong style expected 0xc0 got: 0x%x\n", r);
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r);
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
}
DestroyWindow (hwEdit);
trace("EDIT: Single line want returns\n");
hwEdit = create_editcontrol(ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
r = get_edit_style(hwEdit);
ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%lx\n", r);
ok(r == (ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN), "Wrong style expected 0x10c0 got: 0x%x\n", r);
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %lx\n", r);
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTARROWS got %x\n", r);
}
DestroyWindow (hwEdit);
trace("EDIT: Multiline line\n");
hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
r = get_edit_style(hwEdit);
ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%lx\n", r);
ok(r == (ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0xc4 got: 0x%x\n", r);
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r);
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
}
DestroyWindow (hwEdit);
trace("EDIT: Multi line want returns\n");
hwEdit = create_editcontrol(ES_MULTILINE | WS_VSCROLL | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
r = get_edit_style(hwEdit);
ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%lx\n", r);
ok(r == (ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE), "Wrong style expected 0x10c4 got: 0x%x\n", r);
for (i=0;i<65535;i++)
{
msMessage.wParam = i;
r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM) &msMessage);
ok(r == (DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS),
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %lx\n", r);
"Expected DLGC_WANTCHARS | DLGC_HASSETSEL | DLGC_WANTALLKEYS | DLGC_WANTARROWS got %x\n", r);
}
DestroyWindow (hwEdit);
}
......@@ -863,7 +863,7 @@ static void test_margins_font_change(void)
}
#define edit_pos_ok(exp, got, txt) \
ok(exp == got, "wrong " #txt " expected %d got %ld\n", exp, got);
ok(exp == got, "wrong " #txt " expected %d got %d\n", exp, got);
#define check_pos(hwEdit, set_height, test_top, test_height, test_left) \
do { \
......
......@@ -240,7 +240,7 @@ static void do_test( HWND hwnd, int seqnr, const KEV td[] )
trace("======== key stroke sequence #%d: %s =============\n",
seqnr + 1, buf);
while( PeekMessage(&msg,hwnd,WM_KEYFIRST,WM_KEYLAST,PM_REMOVE) ) {
trace("message[%d] %-15s wParam %04x lParam %08lx time %lx\n", i,
trace("message[%d] %-15s wParam %04x lParam %08lx time %x\n", i,
MSGNAME[msg.message - WM_KEYFIRST], msg.wParam, msg.lParam, msg.time);
if( i < kmctr ) {
ok( msg.message == expmsg[i].message &&
......
......@@ -211,7 +211,7 @@ static void check_item_height(void)
ok (SendMessage(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n");
itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 0, 0);
ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %ld\n", itemHeight, tm.tmHeight);
ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %d\n", itemHeight, tm.tmHeight);
DestroyWindow (hLB);
}
......@@ -232,16 +232,16 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
ok(dis->CtlType == ODT_LISTBOX, "wrong CtlType %04x\n", dis->CtlType);
GetClientRect(dis->hwndItem, &rc_client);
trace("hwndItem %p client rect (%ld,%ld-%ld,%ld)\n", dis->hwndItem,
trace("hwndItem %p client rect (%d,%d-%d,%d)\n", dis->hwndItem,
rc_client.left, rc_client.top, rc_client.right, rc_client.bottom);
GetClipBox(dis->hDC, &rc_clip);
trace("clip rect (%ld,%ld-%ld,%ld)\n", rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom);
trace("clip rect (%d,%d-%d,%d)\n", rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom);
ok(EqualRect(&rc_client, &rc_clip), "client rect of the listbox should be equal to the clip box\n");
trace("rcItem (%ld,%ld-%ld,%ld)\n", dis->rcItem.left, dis->rcItem.top,
trace("rcItem (%d,%d-%d,%d)\n", dis->rcItem.left, dis->rcItem.top,
dis->rcItem.right, dis->rcItem.bottom);
SendMessage(dis->hwndItem, LB_GETITEMRECT, dis->itemID, (LPARAM)&rc_item);
trace("item rect (%ld,%ld-%ld,%ld)\n", rc_item.left, rc_item.top, rc_item.right, rc_item.bottom);
trace("item rect (%d,%d-%d,%d)\n", rc_item.left, rc_item.top, rc_item.right, rc_item.bottom);
ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not equal\n");
break;
......@@ -296,9 +296,9 @@ static void test_ownerdraw(void)
ok(ret == 1, "wrong top index %d\n", ret);
SendMessage(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
trace("item 0 rect (%ld,%ld-%ld,%ld)\n", rc.left, rc.top, rc.right, rc.bottom);
trace("item 0 rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom);
ok(!IsRectEmpty(&rc), "empty item rect\n");
ok(rc.top < 0, "rc.top is not negative (%ld)\n", rc.top);
ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top);
DestroyWindow(hLB);
DestroyWindow(parent);
......
......@@ -80,7 +80,7 @@ static void test_enumdisplaydevices(void)
{
/* test creating DC */
dc = CreateDCA(dd.DeviceName, NULL, NULL, NULL);
ok(dc != NULL, "Failed to CreateDC(\"%s\") err=%ld\n", dd.DeviceName, GetLastError());
ok(dc != NULL, "Failed to CreateDC(\"%s\") err=%d\n", dd.DeviceName, GetLastError());
DeleteDC(dc);
}
num++;
......@@ -140,10 +140,10 @@ static void test_ChangeDisplaySettingsEx(void)
dm.dmDisplayFrequency = vid_modes_test[i].freq;
dm.dmFields = vid_modes_test[i].fields;
res = ChangeDisplaySettingsEx(NULL, &dm, NULL, CDS_FULLSCREEN, NULL);
ok(res == vid_modes_test[i].res, "Failed to change resolution[%d]: %ld\n", i, res);
ok(res == vid_modes_test[i].res, "Failed to change resolution[%d]: %d\n", i, res);
}
res = ChangeDisplaySettingsEx(NULL, NULL, NULL, CDS_RESET, NULL);
ok(res == DISP_CHANGE_SUCCESSFUL, "Failed to reset default resolution: %ld\n", res);
ok(res == DISP_CHANGE_SUCCESSFUL, "Failed to reset default resolution: %d\n", res);
}
......
......@@ -64,18 +64,18 @@ static void test_LoadStringA (void)
}
ret = LoadStringA(hInst, 1, buf, sizeof(buf) );
ok( ret > 0, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
ok( ret > 0, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 1, 0x8000 ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %ld\n", ret, GetLastError());
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 1, 0xffff ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %ld\n", ret, GetLastError());
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ret = LoadStringA(hInst, 65534, buf, sizeof(buf) );
ok( ret > 0, "LoadString failed: ret %d err %ld\n", ret, GetLastError());
ok( ret > 0, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 65534, 0x8000 ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %ld\n", ret, GetLastError());
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 65534, 0xffff ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %ld\n", ret, GetLastError());
"LoadString failed: ret %d err %d\n", ret, GetLastError());
}
static void test_accel1(void)
......
......@@ -46,9 +46,9 @@ static void test_DrawTextCalcRect(void)
/* Initialization */
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP,
0, 0, 200, 200, 0, 0, 0, NULL);
ok(hwnd != 0, "CreateWindowExA error %lu\n", GetLastError());
ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError());
hdc = GetDC(hwnd);
ok(hdc != 0, "GetDC error %lu\n", GetLastError());
ok(hdc != 0, "GetDC error %u\n", GetLastError());
trace("hdc %p\n", hdc);
textlen = lstrlenA(text);
......@@ -65,23 +65,23 @@ static void test_DrawTextCalcRect(void)
SetMapMode(hdc, MM_HIENGLISH);
lf.lfHeight = 100 * 9 / 72; /* 9 point */
hFont = CreateFontIndirectA(&lf);
ok(hFont != 0, "CreateFontIndirectA error %lu\n",
ok(hFont != 0, "CreateFontIndirectA error %u\n",
GetLastError());
hOldFont = SelectObject(hdc, hFont);
textheight = DrawTextA(hdc, text, textlen, &rect, DT_CALCRECT |
DT_EXTERNALLEADING | DT_WORDBREAK | DT_NOCLIP | DT_LEFT |
DT_NOPREFIX);
ok( textheight, "DrawTextA error %lu\n", GetLastError());
ok( textheight, "DrawTextA error %u\n", GetLastError());
trace("MM_HIENGLISH rect.bottom %ld\n", rect.bottom);
trace("MM_HIENGLISH rect.bottom %d\n", rect.bottom);
todo_wine ok(rect.bottom < 0, "In MM_HIENGLISH, DrawText with "
"DT_CALCRECT should return a negative rectangle bottom. "
"(bot=%ld)\n", rect.bottom);
"(bot=%d)\n", rect.bottom);
SelectObject(hdc, hOldFont);
ret = DeleteObject(hFont);
ok( ret, "DeleteObject error %lu\n", GetLastError());
ok( ret, "DeleteObject error %u\n", GetLastError());
/* DrawText in MM_TEXT with DT_CALCRECT */
......@@ -89,18 +89,18 @@ static void test_DrawTextCalcRect(void)
lf.lfHeight = -MulDiv(9, GetDeviceCaps(hdc,
LOGPIXELSY), 72); /* 9 point */
hFont = CreateFontIndirectA(&lf);
ok(hFont != 0, "CreateFontIndirectA error %lu\n",
ok(hFont != 0, "CreateFontIndirectA error %u\n",
GetLastError());
hOldFont = SelectObject(hdc, hFont);
textheight = DrawTextA(hdc, text, textlen, &rect, DT_CALCRECT |
DT_EXTERNALLEADING | DT_WORDBREAK | DT_NOCLIP | DT_LEFT |
DT_NOPREFIX);
ok( textheight, "DrawTextA error %lu\n", GetLastError());
ok( textheight, "DrawTextA error %u\n", GetLastError());
trace("MM_TEXT rect.bottom %ld\n", rect.bottom);
trace("MM_TEXT rect.bottom %d\n", rect.bottom);
ok(rect.bottom > 0, "In MM_TEXT, DrawText with DT_CALCRECT "
"should return a positive rectangle bottom. (bot=%ld)\n",
"should return a positive rectangle bottom. (bot=%d)\n",
rect.bottom);
/* empty or null text should in some cases calc an empty rectangle */
......@@ -148,13 +148,13 @@ static void test_DrawTextCalcRect(void)
SelectObject(hdc, hOldFont);
ret = DeleteObject(hFont);
ok( ret, "DeleteObject error %lu\n", GetLastError());
ok( ret, "DeleteObject error %u\n", GetLastError());
/* Clean up */
ret = ReleaseDC(hwnd, hdc);
ok( ret, "ReleaseDC error %lu\n", GetLastError());
ok( ret, "ReleaseDC error %u\n", GetLastError());
ret = DestroyWindow(hwnd);
ok( ret, "DestroyWindow error %lu\n", GetLastError());
ok( ret, "DestroyWindow error %u\n", GetLastError());
}
/* replace tabs by \t */
......@@ -194,12 +194,12 @@ static void test_TabbedText(void)
/* Initialization */
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP,
0, 0, 200, 200, 0, 0, 0, NULL);
ok(hwnd != 0, "CreateWindowExA error %lu\n", GetLastError());
ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError());
hdc = GetDC(hwnd);
ok(hdc != 0, "GetDC error %lu\n", GetLastError());
ok(hdc != 0, "GetDC error %u\n", GetLastError());
ret = GetTextMetricsA( hdc, &tm);
ok( ret, "GetTextMetrics error %lu\n", GetLastError());
ok( ret, "GetTextMetrics error %u\n", GetLastError());
extent = GetTabbedTextExtentA( hdc, "x", 1, 1, tabs);
cx = LOWORD( extent);
......
......@@ -72,10 +72,10 @@ static DWORD CALLBACK thread( LPVOID arg )
SetLastError( 0xdeadbeef );
ok( !CloseHandle( d1 ), "CloseHandle succeeded\n" );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() );
SetLastError( 0xdeadbeef );
ok( !CloseDesktop( d1 ), "CloseDesktop succeeded\n" );
ok( GetLastError() == ERROR_BUSY, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() );
print_object( d1 );
d2 = CreateDesktop( "foobar2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
trace( "created desktop %p\n", d2 );
......@@ -83,7 +83,7 @@ static DWORD CALLBACK thread( LPVOID arg )
SetLastError( 0xdeadbeef );
ok( !SetThreadDesktop( d2 ), "set thread desktop succeeded with existing window\n" );
ok( GetLastError() == ERROR_BUSY, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() );
DestroyWindow( hwnd );
ok( SetThreadDesktop( d2 ), "set thread desktop failed\n" );
......@@ -116,7 +116,7 @@ static void test_handles(void)
ok( !CloseWindowStation(w1), "closing process win station succeeded\n" );
SetLastError( 0xdeadbeef );
ok( !CloseHandle(w1), "closing process win station handle succeeded\n" );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() );
print_object( w1 );
flags = 0;
......@@ -136,7 +136,7 @@ static void test_handles(void)
ok( w2 != w1, "CreateWindowStation returned default handle\n" );
SetLastError( 0xdeadbeef );
ok( !CloseDesktop( (HDESK)w2 ), "CloseDesktop succeeded on win station\n" );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() );
ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" );
w2 = CreateWindowStation("WinSta0", 0, WINSTA_ALL_ACCESS, NULL );
......@@ -197,11 +197,11 @@ static void test_handles(void)
SetLastError( 0xdeadbeef );
ok( !CloseDesktop(d1), "closing thread desktop succeeded\n" );
ok( GetLastError() == ERROR_BUSY, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() );
SetLastError( 0xdeadbeef );
ok( !CloseHandle(d1), "closing thread desktop handle failed\n" );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() );
ok( DuplicateHandle( GetCurrentProcess(), d1, GetCurrentProcess(), (PHANDLE)&d2, 0,
TRUE, DUPLICATE_SAME_ACCESS ), "DuplicateHandle failed\n" );
......@@ -218,7 +218,7 @@ static void test_handles(void)
ok( d2 != 0, "create foobar desktop failed\n" );
SetLastError( 0xdeadbeef );
ok( !CloseWindowStation( (HWINSTA)d2 ), "CloseWindowStation succeeded on desktop\n" );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %ld\n", GetLastError() );
ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() );
d3 = OpenDesktop( "foobar", 0, TRUE, DESKTOP_ALL_ACCESS );
ok( d3 != 0, "open foobar desktop failed\n" );
......
......@@ -30,7 +30,7 @@ static void wsprintfATest(void)
int rc;
rc=wsprintfA(buf, "%010ld", -1);
ok(rc == 10, "wsPrintfA length failure: rc=%d error=%ld\n",rc,GetLastError());
ok(rc == 10, "wsPrintfA length failure: rc=%d error=%d\n",rc,GetLastError());
ok((lstrcmpA(buf, "-000000001") == 0),
"wsprintfA zero padded negative value failure: buf=[%s]\n",buf);
}
......@@ -45,7 +45,7 @@ static void wsprintfWTest(void)
rc=wsprintfW(buf, fmt, -1);
if (rc==0 && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
return;
ok(rc == 10, "wsPrintfW length failure: rc=%d error=%ld\n",rc,GetLastError());
ok(rc == 10, "wsPrintfW length failure: rc=%d error=%d\n",rc,GetLastError());
ok((lstrcmpW(buf, target) == 0),
"wsprintfW zero padded negative value failure\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment