Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
15e4ad48
Commit
15e4ad48
authored
Apr 16, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Apr 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Basic tests for DeleteMonitor.
parent
3b38308a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
info.c
dlls/winspool/tests/info.c
+84
-0
No files found.
dlls/winspool/tests/info.c
View file @
15e4ad48
...
@@ -331,6 +331,89 @@ static void test_AddMonitor(void)
...
@@ -331,6 +331,89 @@ static void test_AddMonitor(void)
/* ########################### */
/* ########################### */
static
void
test_DeleteMonitor
(
void
)
{
MONITOR_INFO_2A
mi2a
;
struct
monitor_entry
*
entry
=
NULL
;
DWORD
res
;
entry
=
find_installed_monitor
();
if
(
!
entry
)
{
trace
(
"No usable Monitor found: Skip tests
\n
"
);
return
;
}
mi2a
.
pName
=
winetest_monitor
;
mi2a
.
pEnvironment
=
entry
->
env
;
mi2a
.
pDLLName
=
entry
->
dllname
;
/* Testing DeleteMonitor with real options */
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
entry
->
env
,
winetest_monitor
);
ok
(
res
,
"returned %ld with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* Delete the Monitor twice */
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
entry
->
env
,
winetest_monitor
);
/* NT: ERROR_UNKNOWN_PRINT_MONITOR (3000), 9x: ERROR_INVALID_PARAMETER (87) */
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_UNKNOWN_PRINT_MONITOR
)
||
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
)),
"returned %ld with %ld (expected '0' with: ERROR_UNKNOWN_PRINT_MONITOR"
\
" or ERROR_INVALID_PARAMETER)
\n
"
,
res
,
GetLastError
());
/* the environment */
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
NULL
,
winetest_monitor
);
ok
(
res
,
"returned %ld with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
());
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
""
,
winetest_monitor
);
ok
(
res
,
"returned %ld with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
());
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
"bad_env"
,
winetest_monitor
);
ok
(
res
,
"returned %ld with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
());
/* the monitor-name */
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
entry
->
env
,
NULL
);
/* NT: ERROR_INVALID_PARAMETER (87), 9x: ERROR_INVALID_NAME (123)*/
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_INVALID_PARAMETER
)
||
(
GetLastError
()
==
ERROR_INVALID_NAME
)),
"returned %ld with %ld (expected '0' with: ERROR_INVALID_PARAMETER or "
\
"ERROR_INVALID_NAME)
\n
"
,
res
,
GetLastError
());
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
NULL
,
entry
->
env
,
""
);
/* NT: ERROR_INVALID_PARAMETER (87), 9x: ERROR_INVALID_NAME (123)*/
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_INVALID_PARAMETER
)
||
(
GetLastError
()
==
ERROR_INVALID_NAME
)),
"returned %ld with %ld (expected '0' with: ERROR_INVALID_PARAMETER or "
\
"ERROR_INVALID_NAME)
\n
"
,
res
,
GetLastError
());
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
SetLastError
(
MAGIC_DEAD
);
res
=
DeleteMonitorA
(
""
,
entry
->
env
,
winetest_monitor
);
ok
(
res
,
"returned %ld with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
());
/* cleanup */
DeleteMonitorA
(
NULL
,
entry
->
env
,
winetest_monitor
);
}
/* ########################### */
static
void
test_EnumMonitors
(
void
)
static
void
test_EnumMonitors
(
void
)
{
{
DWORD
res
;
DWORD
res
;
...
@@ -1008,6 +1091,7 @@ START_TEST(info)
...
@@ -1008,6 +1091,7 @@ START_TEST(info)
find_default_printer
();
find_default_printer
();
test_AddMonitor
();
test_AddMonitor
();
test_DeleteMonitor
();
test_EnumMonitors
();
test_EnumMonitors
();
test_GetDefaultPrinter
();
test_GetDefaultPrinter
();
test_GetPrinterDriverDirectory
();
test_GetPrinterDriverDirectory
();
...
...
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