Commit fd71f876 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

user32/tests: Don't test function directly when reporting GetLastError().

parent 8b0a2c28
......@@ -9516,8 +9516,8 @@ static DWORD CALLBACK send_msg_thread_2(void *param)
case WAIT_OBJECT_0 + EV_SENDMSG:
trace("thread: sending message\n");
ok( SendNotifyMessageA(info->hwnd, WM_USER, 0, 0),
"SendNotifyMessageA failed error %u\n", GetLastError());
ret = SendNotifyMessageA(info->hwnd, WM_USER, 0, 0);
ok(ret, "SendNotifyMessageA failed error %u\n", GetLastError());
SetEvent(info->hevent[EV_ACK]);
break;
......
......@@ -90,7 +90,7 @@ static void test_LoadStringA (void)
{sizeof str, sizeof str - 1},
{sizeof str - 1, sizeof str - 2}};
unsigned int i;
int ret;
int ret, ret2;
assert (sizeof str < sizeof buf);
for (i = 0; i < sizeof tests / sizeof tests[0]; i++) {
......@@ -110,17 +110,17 @@ static void test_LoadStringA (void)
ret = LoadStringA(hInst, 1, buf, sizeof(buf) );
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 %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 1, 0xffff ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ret2 = LoadStringA( hInst, MAKELONG( 1, 0x8000 ), buf, sizeof(buf));
ok( ret2 == ret, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ret2 = LoadStringA( hInst, MAKELONG( 1, 0xffff ), buf, sizeof(buf));
ok( ret2 == ret, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ret = LoadStringA(hInst, 65534, buf, sizeof(buf) );
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 %d\n", ret, GetLastError());
ok( LoadStringA( hInst, MAKELONG( 65534, 0xffff ), buf, sizeof(buf)) == ret,
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ret2 = LoadStringA( hInst, MAKELONG( 65534, 0x8000 ), buf, sizeof(buf));
ok( ret2 == ret, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ret2 = LoadStringA( hInst, MAKELONG( 65534, 0xffff ), buf, sizeof(buf));
ok( ret2 == ret, "LoadString failed: ret %d err %d\n", ret, GetLastError());
ret = LoadStringA(hInst, 0, buf, 0);
ok( ret == -1 || broken(ret == 0),
......
......@@ -5094,20 +5094,20 @@ static void test_CreateWindow(void)
ok( !pGetProcessDefaultLayout( NULL ), "GetProcessDefaultLayout succeeded\n" );
ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
ok( pGetProcessDefaultLayout( &layout ),
"GetProcessDefaultLayout failed err %u\n", GetLastError ());
res = pGetProcessDefaultLayout( &layout );
ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
ok( layout == 0, "GetProcessDefaultLayout wrong layout %x\n", layout );
SetLastError( 0xdeadbeef );
ok( pSetProcessDefaultLayout( 7 ),
"SetProcessDefaultLayout failed err %u\n", GetLastError ());
ok( pGetProcessDefaultLayout( &layout ),
"GetProcessDefaultLayout failed err %u\n", GetLastError ());
res = pSetProcessDefaultLayout( 7 );
ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
res = pGetProcessDefaultLayout( &layout );
ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
ok( layout == 7, "GetProcessDefaultLayout wrong layout %x\n", layout );
SetLastError( 0xdeadbeef );
ok( pSetProcessDefaultLayout( LAYOUT_RTL ),
"SetProcessDefaultLayout failed err %u\n", GetLastError ());
ok( pGetProcessDefaultLayout( &layout ),
"GetProcessDefaultLayout failed err %u\n", GetLastError ());
res = pSetProcessDefaultLayout( LAYOUT_RTL );
ok( res, "SetProcessDefaultLayout failed err %u\n", GetLastError ());
res = pGetProcessDefaultLayout( &layout );
ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ());
ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %x\n", layout );
hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP,
0, 0, 100, 100, 0, 0, 0, NULL);
......
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