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
d19bb783
Commit
d19bb783
authored
Oct 07, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add a test for AbortProc handling.
parent
4f2a3c2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
Makefile.in
dlls/comdlg32/tests/Makefile.in
+1
-1
printdlg.c
dlls/comdlg32/tests/printdlg.c
+72
-0
No files found.
dlls/comdlg32/tests/Makefile.in
View file @
d19bb783
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
comdlg32.dll
TESTDLL
=
comdlg32.dll
IMPORTS
=
comdlg32 user32 kernel32
IMPORTS
=
comdlg32 user32
gdi32
kernel32
CTESTS
=
\
CTESTS
=
\
filedlg.c
\
filedlg.c
\
...
...
dlls/comdlg32/tests/printdlg.c
View file @
d19bb783
...
@@ -289,6 +289,77 @@ static void test_PrintDlgExW(void)
...
@@ -289,6 +289,77 @@ static void test_PrintDlgExW(void)
}
}
static
BOOL
abort_proc_called
=
FALSE
;
static
BOOL
CALLBACK
abort_proc
(
HDC
hdc
,
int
error
)
{
return
abort_proc_called
=
TRUE
;
}
static
void
test_abort_proc
(
void
)
{
HDC
print_dc
;
RECT
rect
=
{
0
,
0
,
100
,
100
};
DOCINFOA
doc_info
=
{
0
};
PRINTDLGA
pd
=
{
0
};
char
filename
[
MAX_PATH
];
if
(
!
GetTempFileNameA
(
"."
,
"prn"
,
0
,
filename
))
{
skip
(
"Failed to create a temporary file name
\n
"
);
return
;
}
pd
.
lStructSize
=
sizeof
(
pd
);
pd
.
Flags
=
PD_RETURNDEFAULT
|
PD_ALLPAGES
|
PD_RETURNDC
|
PD_PRINTTOFILE
;
pd
.
nFromPage
=
1
;
pd
.
nToPage
=
1
;
pd
.
nCopies
=
1
;
if
(
!
PrintDlgA
(
&
pd
))
{
skip
(
"No default printer available.
\n
"
);
ok
(
DeleteFileA
(
filename
),
"Failed to delete temporary file
\n
"
);
return
;
}
ok
(
pd
.
hDC
!=
NULL
,
"PrintDlg didn't return a DC.
\n
"
);
if
(
!
(
print_dc
=
pd
.
hDC
))
{
ok
(
DeleteFileA
(
filename
),
"Failed to delete temporary file
\n
"
);
return
;
}
ok
(
SetAbortProc
(
print_dc
,
abort_proc
)
>
0
,
"SetAbortProc failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by SetAbortProc.
\n
"
);
abort_proc_called
=
FALSE
;
doc_info
.
cbSize
=
sizeof
(
doc_info
);
doc_info
.
lpszDocName
=
"Some document"
;
doc_info
.
lpszOutput
=
filename
;
ok
(
StartDocA
(
print_dc
,
&
doc_info
)
>
0
,
"StartDocA failed
\n
"
);
ok
(
abort_proc_called
,
"AbortProc didn't get called by StartDoc.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
StartPage
(
print_dc
)
>
0
,
"StartPage failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by StartPage.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
FillRect
(
print_dc
,
&
rect
,
(
HBRUSH
)(
COLOR_BACKGROUND
+
1
)),
"FillRect failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by StretchBlt.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
EndPage
(
print_dc
)
>
0
,
"EndPage failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by EndPage.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
EndDoc
(
print_dc
)
>
0
,
"EndDoc failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by EndDoc.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
DeleteDC
(
print_dc
),
"DeleteDC failed
\n
"
);
ok
(
!
abort_proc_called
,
"AbortProc got called unexpectedly by DeleteDC.
\n
"
);
abort_proc_called
=
FALSE
;
ok
(
DeleteFileA
(
filename
),
"Failed to delete temporary file
\n
"
);
}
/* ########################### */
/* ########################### */
START_TEST
(
printdlg
)
START_TEST
(
printdlg
)
...
@@ -299,6 +370,7 @@ START_TEST(printdlg)
...
@@ -299,6 +370,7 @@ START_TEST(printdlg)
test_PageSetupDlgA
();
test_PageSetupDlgA
();
test_PrintDlgA
();
test_PrintDlgA
();
test_abort_proc
();
/* PrintDlgEx not present before w2k */
/* PrintDlgEx not present before w2k */
if
(
ptr
)
{
if
(
ptr
)
{
...
...
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