Commit 591f107c authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

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

parent f3e7c538
......@@ -98,11 +98,11 @@ static void test_AddPort(void)
SetLastError(0xdeadbeef);
res = pAddPort(NULL, 0, emptyW);
ok(!res, "returned %d with 0x%x (expected '0')\n", res, GetLastError());
ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pAddPort(NULL, 0, does_not_existW);
ok(!res, "returned %d with 0x%x (expected '0')\n", res, GetLastError());
ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError());
}
......@@ -135,15 +135,15 @@ static void test_ConfigurePort(void)
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_com1W);
trace("returned %d with %d\n", res, GetLastError());
trace("returned %d with %u\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_lpt1W);
trace("returned %d with %d\n", res, GetLastError());
trace("returned %d with %u\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_fileW);
trace("returned %d with %d\n", res, GetLastError());
trace("returned %d with %u\n", res, GetLastError());
}
}
......@@ -172,11 +172,11 @@ static void test_DeletePort(void)
SetLastError(0xdeadbeef);
res = pDeletePort(NULL, 0, emptyW);
ok(!res, "returned %d with 0x%x (expected '0')\n", res, GetLastError());
ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pDeletePort(NULL, 0, does_not_existW);
ok(!res, "returned %d with 0x%x (expected '0')\n", res, GetLastError());
ok(!res, "returned %d with %u (expected '0')\n", res, GetLastError());
}
......@@ -206,13 +206,13 @@ static void test_EnumPorts(void)
/* NT4 fails with ERROR_INVALID_LEVEL (as expected)
XP succeeds with ERROR_SUCCESS () */
ok( (cbBuf == 0) && (pcReturned == 0),
"(%d) returned %d with %d and %d, %d (expected 0, 0)\n",
"(%d) returned %d with %u and %d, %d (expected 0, 0)\n",
level, res, GetLastError(), cbBuf, pcReturned);
continue;
}
ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER),
"(%d) returned %d with %d and %d, %d (expected '0' with "
"(%d) returned %d with %u and %d, %d (expected '0' with "
"ERROR_INSUFFICIENT_BUFFER)\n",
level, res, GetLastError(), cbBuf, pcReturned);
......@@ -223,7 +223,7 @@ static void test_EnumPorts(void)
pcReturned = 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pEnumPorts(NULL, level, buffer, cbBuf, &pcbNeeded, &pcReturned);
ok( res, "(%d) returned %d with %d and %d, %d (expected '!= 0')\n",
ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
level, res, GetLastError(), pcbNeeded, pcReturned);
/* We can compare the returned Data with the Registry / "win.ini",[Ports] here */
......@@ -231,7 +231,7 @@ static void test_EnumPorts(void)
pcReturned = 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pEnumPorts(NULL, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned);
ok( res, "(%d) returned %d with %d and %d, %d (expected '!= 0')\n",
ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
level, res, GetLastError(), pcbNeeded, pcReturned);
pcbNeeded = 0xdeadbeef;
......@@ -239,7 +239,7 @@ static void test_EnumPorts(void)
SetLastError(0xdeadbeef);
res = pEnumPorts(NULL, level, buffer, cbBuf-1, &pcbNeeded, &pcReturned);
ok( !res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER),
"(%d) returned %d with %d and %d, %d (expected '0' with "
"(%d) returned %d with %u and %d, %d (expected '0' with "
"ERROR_INSUFFICIENT_BUFFER)\n",
level, res, GetLastError(), pcbNeeded, pcReturned);
......@@ -256,14 +256,14 @@ static void test_EnumPorts(void)
pcReturned = 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pEnumPorts(emptyW, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned);
ok( res, "(%d) returned %d with %d and %d, %d (expected '!= 0')\n",
ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
level, res, GetLastError(), pcbNeeded, pcReturned);
pcbNeeded = 0xdeadbeef;
pcReturned = 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pEnumPorts(server_does_not_existW, level, buffer, cbBuf+1, &pcbNeeded, &pcReturned);
ok( res, "(%d) returned %d with %d and %d, %d (expected '!= 0')\n",
ok( res, "(%d) returned %d with %u and %d, %d (expected '!= 0')\n",
level, res, GetLastError(), pcbNeeded, pcReturned);
HeapFree(GetProcessHeap(), 0, buffer);
......@@ -281,13 +281,13 @@ static void test_InitializePrintMonitor(void)
res = pInitializePrintMonitor(NULL);
/* The Parameter was unchecked before w2k */
ok( res || (GetLastError() == ERROR_INVALID_PARAMETER),
"returned %p with %d\n (expected '!= NULL' or: NULL with "
"returned %p with %u\n (expected '!= NULL' or: NULL with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pInitializePrintMonitor(emptyW);
ok( res || (GetLastError() == ERROR_INVALID_PARAMETER),
"returned %p with %d\n (expected '!= NULL' or: NULL with "
"returned %p with %u\n (expected '!= NULL' or: NULL with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError());
......@@ -295,7 +295,7 @@ static void test_InitializePrintMonitor(void)
SetLastError(0xdeadbeef);
res = pInitializePrintMonitor(Monitors_LocalPortW);
ok( res == pm,
"returned %p with %d (expected %p)\n", res, GetLastError(), pm);
"returned %p with %u (expected %p)\n", res, GetLastError(), pm);
}
/* ########################### */
......@@ -318,12 +318,12 @@ static void test_XcvClosePort(void)
SetLastError(0xdeadbeef);
hXcv = (HANDLE) 0xdeadbeef;
res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (res) {
SetLastError(0xdeadbeef);
res = pXcvClosePort(hXcv);
ok( res, "returned %d with 0x%x(expected '!= 0')\n", res, GetLastError());
ok( res, "returned %d with %u (expected '!= 0')\n", res, GetLastError());
if (0)
{
......@@ -349,7 +349,7 @@ static void test_XcvDataPort(void)
hXcv = (HANDLE) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (!res) return;
/* ask for needed size */
......@@ -357,7 +357,7 @@ static void test_XcvDataPort(void)
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, NULL, 0, &needed);
ok( (res == ERROR_INSUFFICIENT_BUFFER) && (needed <= MAX_PATH),
"returned %d with 0x%x and 0x%x (expected 'ERROR_INSUFFICIENT_BUFFER' "
"returned %d with %u and 0x%x (expected 'ERROR_INSUFFICIENT_BUFFER' "
" and '<= MAX_PATH')\n", res, GetLastError(), needed);
if (needed > MAX_PATH) goto xcv_cleanup;
......@@ -367,7 +367,7 @@ static void test_XcvDataPort(void)
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, emptyW, NULL, 0, NULL, 0, &needed);
ok( res == ERROR_INVALID_PARAMETER, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_INVALID_PARAMETER, "returned %d with %u and 0x%x "
"(expected 'ERROR_INVALID_PARAMETER')\n", res, GetLastError(), needed);
if (0) {
......@@ -382,7 +382,7 @@ static void test_XcvDataPort(void)
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(NULL, cmd_MonitorUIW, NULL, 0, buffer, len, &needed);
ok( res == ERROR_SUCCESS, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x "
"(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
......@@ -391,14 +391,14 @@ static void test_XcvDataPort(void)
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, cmd_MonitorUI_lcaseW, NULL, 0, buffer, len, &needed);
ok( res == ERROR_INVALID_PARAMETER, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_INVALID_PARAMETER, "returned %d with %u and 0x%x "
"(expected 'ERROR_INVALID_PARAMETER')\n", res, GetLastError(), needed);
/* off by one: larger */
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len+1, &needed);
ok( res == ERROR_SUCCESS, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x "
"(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
......@@ -406,7 +406,7 @@ static void test_XcvDataPort(void)
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len-1, &needed);
ok( res == ERROR_INSUFFICIENT_BUFFER, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_INSUFFICIENT_BUFFER, "returned %d with %u and 0x%x "
"(expected 'ERROR_INSUFFICIENT_BUFFER')\n", res, GetLastError(), needed);
/* Normal use. The DLL-Name without a Path is returned */
......@@ -414,7 +414,7 @@ static void test_XcvDataPort(void)
needed = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
res = pXcvDataPort(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len, &needed);
ok( res == ERROR_SUCCESS, "returned %d with 0x%x and 0x%x "
ok( res == ERROR_SUCCESS, "returned %d with %u and 0x%x "
"(expected 'ERROR_SUCCESS')\n", res, GetLastError(), needed);
xcv_cleanup:
......@@ -443,7 +443,7 @@ static void test_XcvOpenPort(void)
SetLastError(0xdeadbeef);
hXcv = (HANDLE) 0xdeadbeef;
res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (res) pXcvClosePort(hXcv);
......@@ -451,7 +451,7 @@ static void test_XcvOpenPort(void)
SetLastError(0xdeadbeef);
hXcv = (HANDLE) 0xdeadbeef;
res = pXcvOpenPort(emptyW, 0, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (res) pXcvClosePort(hXcv);
......@@ -459,13 +459,13 @@ static void test_XcvOpenPort(void)
SetLastError(0xdeadbeef);
hXcv = (HANDLE) 0xdeadbeef;
res = pXcvOpenPort(portname_lpt1W, SERVER_ALL_ACCESS, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (res) pXcvClosePort(hXcv);
SetLastError(0xdeadbeef);
hXcv = (HANDLE) 0xdeadbeef;
res = pXcvOpenPort(portname_fileW, SERVER_ALL_ACCESS, &hXcv);
ok(res, "returned %d with 0x%x and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv);
if (res) pXcvClosePort(hXcv);
}
......
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