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
164a76fd
Commit
164a76fd
authored
Mar 18, 2012
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Mar 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32/tests: Test more parameters for PrintDlgEx.
parent
c2aeac3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
printdlg.c
dlls/comdlg32/tests/printdlg.c
+81
-0
No files found.
dlls/comdlg32/tests/printdlg.c
View file @
164a76fd
...
...
@@ -212,7 +212,9 @@ static void test_PrintDlgA(void)
static
void
test_PrintDlgExW
(
void
)
{
PRINTPAGERANGE
pagerange
[
2
];
LPPRINTDLGEXW
pDlg
;
DEVNAMES
*
dn
;
HRESULT
res
;
/* PrintDlgEx not present before w2k */
...
...
@@ -262,6 +264,85 @@ static void test_PrintDlgExW(void)
"got 0x%x with %u and %u (expected 'E_HANDLE')
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
/* nStartPage must be START_PAGE_GENERAL for the general page or a valid property sheet index */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* Use PD_NOPAGENUMS or set nMaxPageRanges and lpPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this is invalid: a valid lpPageRanges with 0 for nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
;
pDlg
->
lpPageRanges
=
pagerange
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this is invalid: NULL for lpPageRanges with a valid nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
;
pDlg
->
nMaxPageRanges
=
1
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this works: lpPageRanges with a valid nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
;
pDlg
->
nMaxPageRanges
=
1
;
pDlg
->
lpPageRanges
=
pagerange
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
if
(
res
==
E_FAIL
)
{
skip
(
"No printer configured.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
pDlg
);
return
;
}
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
dn
=
GlobalLock
(
pDlg
->
hDevNames
);
ok
(
dn
!=
NULL
,
"expected '!= NULL' for GlobalLock(%p)
\n
"
,
pDlg
->
hDevNames
);
if
(
dn
)
{
ok
(
dn
->
wDriverOffset
,
"(expected '!= 0' for wDriverOffset)
\n
"
);
ok
(
dn
->
wDeviceOffset
,
"(expected '!= 0' for wDeviceOffset)
\n
"
);
ok
(
dn
->
wOutputOffset
,
"(expected '!= 0' for wOutputOffset)
\n
"
);
ok
(
dn
->
wDefault
==
DN_DEFAULTPRN
,
"got 0x%x (expected DN_DEFAULTPRN)
\n
"
,
dn
->
wDefault
);
GlobalUnlock
(
pDlg
->
hDevNames
);
}
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
/* this works also: PD_NOPAGENUMS */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
pDlg
->
lStructSize
=
sizeof
(
PRINTDLGEXW
);
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
HeapFree
(
GetProcessHeap
(),
0
,
pDlg
);
return
;
...
...
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