winspool.drv/tests: Remove always true sub-condition (PVS-Studio).

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2015-10-14 09:34:10 +02:00 committed by Alexandre Julliard
parent 7894033af5
commit c62a95d2df
1 changed files with 13 additions and 14 deletions

View File

@ -721,8 +721,7 @@ static void test_DeleteMonitor(void)
AddMonitorA(NULL, 2, (LPBYTE) &mi2a); AddMonitorA(NULL, 2, (LPBYTE) &mi2a);
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = DeleteMonitorA(NULL, invalid_env, winetest); res = DeleteMonitorA(NULL, invalid_env, winetest);
ok( res || ok( res || GetLastError() == ERROR_INVALID_ENVIRONMENT /* Vista/W2K8 */,
(!res && GetLastError() == ERROR_INVALID_ENVIRONMENT) /* Vista/W2K8 */,
"returned %d with %d\n", res, GetLastError()); "returned %d with %d\n", res, GetLastError());
/* the monitor-name */ /* the monitor-name */
@ -1012,7 +1011,7 @@ static void test_EnumMonitors(void)
pcbNeeded = MAGIC_DEAD; pcbNeeded = MAGIC_DEAD;
pcReturned = MAGIC_DEAD; pcReturned = MAGIC_DEAD;
res = EnumMonitorsA(NULL, level, buffer, cbBuf, NULL, &pcReturned); res = EnumMonitorsA(NULL, level, buffer, cbBuf, NULL, &pcReturned);
ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , ok( res || GetLastError() == RPC_X_NULL_REF_POINTER,
"(%d) returned %d with %d (expected '!=0' or '0' with " "(%d) returned %d with %d (expected '!=0' or '0' with "
"RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError());
@ -1020,7 +1019,7 @@ static void test_EnumMonitors(void)
pcReturned = MAGIC_DEAD; pcReturned = MAGIC_DEAD;
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = EnumMonitorsA(NULL, level, buffer, cbBuf, &pcbNeeded, NULL); res = EnumMonitorsA(NULL, level, buffer, cbBuf, &pcbNeeded, NULL);
ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , ok( res || GetLastError() == RPC_X_NULL_REF_POINTER,
"(%d) returned %d with %d (expected '!=0' or '0' with " "(%d) returned %d with %d (expected '!=0' or '0' with "
"RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError());
@ -1230,7 +1229,7 @@ static void test_EnumPrinterDrivers(void)
pcbNeeded = 0xdeadbeef; pcbNeeded = 0xdeadbeef;
pcReturned = 0xdeadbeef; pcReturned = 0xdeadbeef;
res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, NULL, &pcReturned); res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, NULL, &pcReturned);
ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , ok( res || GetLastError() == RPC_X_NULL_REF_POINTER,
"(%u) got %u with %u (expected '!=0' or '0' with " "(%u) got %u with %u (expected '!=0' or '0' with "
"RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError());
@ -1238,7 +1237,7 @@ static void test_EnumPrinterDrivers(void)
pcReturned = 0xdeadbeef; pcReturned = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, &pcbNeeded, NULL); res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, &pcbNeeded, NULL);
ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , ok( res || GetLastError() == RPC_X_NULL_REF_POINTER,
"(%u) got %u with %u (expected '!=0' or '0' with " "(%u) got %u with %u (expected '!=0' or '0' with "
"RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError());
@ -1790,7 +1789,7 @@ static void test_OpenPrinter(void)
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = OpenPrinterA(NULL, &hprinter, NULL); res = OpenPrinterA(NULL, &hprinter, NULL);
if (is_spooler_deactivated(res, GetLastError())) return; if (is_spooler_deactivated(res, GetLastError())) return;
ok(res || (!res && GetLastError() == ERROR_INVALID_PARAMETER), ok(res || GetLastError() == ERROR_INVALID_PARAMETER,
"returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n", "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n",
res, GetLastError()); res, GetLastError());
if(res) { if(res) {
@ -1824,7 +1823,7 @@ static void test_OpenPrinter(void)
hprinter = (HANDLE) 0xdeadbeef; hprinter = (HANDLE) 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = OpenPrinterA(local_server, &hprinter, NULL); res = OpenPrinterA(local_server, &hprinter, NULL);
ok(res || (!res && GetLastError() == ERROR_INVALID_PARAMETER), ok(res || GetLastError() == ERROR_INVALID_PARAMETER,
"returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n", "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n",
res, GetLastError()); res, GetLastError());
if(res) ClosePrinter(hprinter); if(res) ClosePrinter(hprinter);
@ -1965,21 +1964,21 @@ static void test_SetDefaultPrinter(void)
WriteProfileStringA("windows", "device", org_value); WriteProfileStringA("windows", "device", org_value);
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = pSetDefaultPrinterA(""); res = pSetDefaultPrinterA("");
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
WriteProfileStringA("windows", "device", org_value); WriteProfileStringA("windows", "device", org_value);
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = pSetDefaultPrinterA(NULL); res = pSetDefaultPrinterA(NULL);
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
WriteProfileStringA("windows", "device", org_value); WriteProfileStringA("windows", "device", org_value);
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = pSetDefaultPrinterA(default_printer); res = pSetDefaultPrinterA(default_printer);
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
@ -2000,7 +1999,7 @@ static void test_SetDefaultPrinter(void)
goto restore_old_printer; goto restore_old_printer;
/* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */ /* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
@ -2008,14 +2007,14 @@ static void test_SetDefaultPrinter(void)
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = pSetDefaultPrinterA(NULL); res = pSetDefaultPrinterA(NULL);
/* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */ /* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
WriteProfileStringA("windows", "device", NULL); WriteProfileStringA("windows", "device", NULL);
SetLastError(MAGIC_DEAD); SetLastError(MAGIC_DEAD);
res = pSetDefaultPrinterA(default_printer); res = pSetDefaultPrinterA(default_printer);
ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME,
"returned %d with %d (expected '!=0' or '0' with " "returned %d with %d (expected '!=0' or '0' with "
"ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());