Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
93f9b4e1
Commit
93f9b4e1
authored
14 years ago
by
Andrew Eikum
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
comdlg32/tests: Untie ok_testcases from test_ok().
parent
1a1ef6e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comdlg32/tests/filedlg.c
+18
-16
18 additions, 16 deletions
dlls/comdlg32/tests/filedlg.c
with
18 additions
and
16 deletions
dlls/comdlg32/tests/filedlg.c
+
18
−
16
View file @
93f9b4e1
...
...
@@ -562,14 +562,16 @@ static void test_resize(void)
/* test cases for control message IDOK */
/* Show case for bug #19079 */
static
struct
{
typedef
struct
{
int
retval
;
/* return code of the message handler */
BOOL
setmsgresult
;
/* set the result in the DWLP_MSGRESULT */
BOOL
usemsgokstr
;
/* use the FILEOKSTRING message instead of WM_NOTIFY:CDN_FILEOK */
BOOL
do_subclass
;
/* subclass the dialog hook procedure */
BOOL
expclose
;
/* is the dialog expected to close ? */
BOOL
actclose
;
/* has the dialog actually closed ? */
}
ok_testcases
[]
=
{
}
ok_wndproc_testcase
;
static
ok_wndproc_testcase
ok_testcases
[]
=
{
{
0
,
FALSE
,
FALSE
,
FALSE
,
TRUE
},
{
0
,
TRUE
,
FALSE
,
FALSE
,
TRUE
},
{
0
,
FALSE
,
FALSE
,
TRUE
,
TRUE
},
...
...
@@ -590,12 +592,12 @@ static struct {
static
LONG_PTR
WINAPI
test_ok_wndproc
(
HWND
dlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
parent
=
GetParent
(
dlg
);
static
int
index
;
static
ok_wndproc_testcase
*
testcase
=
NULL
;
static
UINT
msgFILEOKSTRING
;
if
(
msg
==
WM_INITDIALOG
)
{
index
=
((
OPENFILENAME
*
)
lParam
)
->
lCustData
;
ok_
testcase
s
[
index
].
actclose
=
TRUE
;
testcase
=
(
ok_wndproc_testcase
*
)
((
OPENFILENAME
*
)
lParam
)
->
lCustData
;
testcase
->
actclose
=
TRUE
;
msgFILEOKSTRING
=
RegisterWindowMessageA
(
FILEOKSTRING
);
}
if
(
msg
==
WM_NOTIFY
)
{
...
...
@@ -604,28 +606,28 @@ static LONG_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM
PostMessage
(
parent
,
WM_COMMAND
,
IDOK
,
0
);
return
FALSE
;
}
else
if
(((
LPNMHDR
)
lParam
)
->
code
==
CDN_FILEOK
)
{
if
(
ok_
testcase
s
[
index
].
usemsgokstr
)
if
(
testcase
->
usemsgokstr
)
return
FALSE
;
if
(
ok_
testcase
s
[
index
].
setmsgresult
)
SetWindowLongPtrA
(
dlg
,
DWLP_MSGRESULT
,
ok_
testcase
s
[
index
].
retval
);
return
ok_
testcase
s
[
index
].
retval
;
if
(
testcase
->
setmsgresult
)
SetWindowLongPtrA
(
dlg
,
DWLP_MSGRESULT
,
testcase
->
retval
);
return
testcase
->
retval
;
}
}
if
(
msg
==
msgFILEOKSTRING
)
{
if
(
!
ok_
testcase
s
[
index
].
usemsgokstr
)
if
(
!
testcase
->
usemsgokstr
)
return
FALSE
;
if
(
ok_
testcase
s
[
index
].
setmsgresult
)
SetWindowLongPtrA
(
dlg
,
DWLP_MSGRESULT
,
ok_
testcase
s
[
index
].
retval
);
return
ok_
testcase
s
[
index
].
retval
;
if
(
testcase
->
setmsgresult
)
SetWindowLongPtrA
(
dlg
,
DWLP_MSGRESULT
,
testcase
->
retval
);
return
testcase
->
retval
;
}
if
(
msg
==
WM_TIMER
)
{
/* the dialog did not close automatically */
ok_
testcase
s
[
index
].
actclose
=
FALSE
;
testcase
->
actclose
=
FALSE
;
KillTimer
(
dlg
,
0
);
PostMessage
(
parent
,
WM_COMMAND
,
IDCANCEL
,
0
);
return
FALSE
;
}
if
(
ok_
testcase
s
[
index
].
do_subclass
)
if
(
testcase
&&
testcase
->
do_subclass
)
return
DefWindowProc
(
dlg
,
msg
,
wParam
,
lParam
);
return
FALSE
;
}
...
...
@@ -658,7 +660,7 @@ static void test_ok(void)
ofn
.
Flags
=
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
;
for
(
i
=
0
;
ok_testcases
[
i
].
retval
!=
-
1
;
i
++
)
{
strcpy
(
filename
,
tmpfilename
);
ofn
.
lCustData
=
i
;
ofn
.
lCustData
=
(
LPARAM
)(
ok_testcases
+
i
)
;
ofn
.
lpfnHook
=
ok_testcases
[
i
].
do_subclass
?
(
LPOFNHOOKPROC
)
ok_template_hook
:
(
LPOFNHOOKPROC
)
test_ok_wndproc
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment