Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c62a95d2
Commit
c62a95d2
authored
Oct 14, 2015
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
>
parent
7894033a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
info.c
dlls/winspool.drv/tests/info.c
+13
-14
No files found.
dlls/winspool.drv/tests/info.c
View file @
c62a95d2
...
...
@@ -721,8 +721,7 @@ static void test_DeleteMonitor(void)
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
invalid_env
,
winetest
);
ok
(
res
||
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_ENVIRONMENT
)
/* Vista/W2K8 */
,
ok
(
res
||
GetLastError
()
==
ERROR_INVALID_ENVIRONMENT
/* Vista/W2K8 */
,
"returned %d with %d
\n
"
,
res
,
GetLastError
());
/* the monitor-name */
...
...
@@ -1012,7 +1011,7 @@ static void test_EnumMonitors(void)
pcbNeeded
=
MAGIC_DEAD
;
pcReturned
=
MAGIC_DEAD
;
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 "
"RPC_X_NULL_REF_POINTER)
\n
"
,
level
,
res
,
GetLastError
());
...
...
@@ -1020,7 +1019,7 @@ static void test_EnumMonitors(void)
pcReturned
=
MAGIC_DEAD
;
SetLastError
(
MAGIC_DEAD
);
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 "
"RPC_X_NULL_REF_POINTER)
\n
"
,
level
,
res
,
GetLastError
());
...
...
@@ -1230,7 +1229,7 @@ static void test_EnumPrinterDrivers(void)
pcbNeeded
=
0xdeadbeef
;
pcReturned
=
0xdeadbeef
;
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 "
"RPC_X_NULL_REF_POINTER)
\n
"
,
level
,
res
,
GetLastError
());
...
...
@@ -1238,7 +1237,7 @@ static void test_EnumPrinterDrivers(void)
pcReturned
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
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 "
"RPC_X_NULL_REF_POINTER)
\n
"
,
level
,
res
,
GetLastError
());
...
...
@@ -1790,7 +1789,7 @@ static void test_OpenPrinter(void)
SetLastError
(
MAGIC_DEAD
);
res
=
OpenPrinterA
(
NULL
,
&
hprinter
,
NULL
);
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
"
,
res
,
GetLastError
());
if
(
res
)
{
...
...
@@ -1824,7 +1823,7 @@ static void test_OpenPrinter(void)
hprinter
=
(
HANDLE
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
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
"
,
res
,
GetLastError
());
if
(
res
)
ClosePrinter
(
hprinter
);
...
...
@@ -1965,21 +1964,21 @@ static void test_SetDefaultPrinter(void)
WriteProfileStringA
(
"windows"
,
"device"
,
org_value
);
SetLastError
(
MAGIC_DEAD
);
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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
WriteProfileStringA
(
"windows"
,
"device"
,
org_value
);
SetLastError
(
MAGIC_DEAD
);
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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
WriteProfileStringA
(
"windows"
,
"device"
,
org_value
);
SetLastError
(
MAGIC_DEAD
);
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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
...
...
@@ -2000,7 +1999,7 @@ static void test_SetDefaultPrinter(void)
goto
restore_old_printer
;
/* 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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
...
...
@@ -2008,14 +2007,14 @@ static void test_SetDefaultPrinter(void)
SetLastError
(
MAGIC_DEAD
);
res
=
pSetDefaultPrinterA
(
NULL
);
/* 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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
WriteProfileStringA
(
"windows"
,
"device"
,
NULL
);
SetLastError
(
MAGIC_DEAD
);
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 "
"ERROR_INVALID_PRINTER_NAME)
\n
"
,
res
,
GetLastError
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment