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
4bbde8fd
Commit
4bbde8fd
authored
Nov 01, 2010
by
Eryk Wieliczko
Committed by
Alexandre Julliard
Nov 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32/tests: Add GetSaveFileName .* extension test.
parent
bd0fe7d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
filedlg.c
dlls/comdlg32/tests/filedlg.c
+48
-0
No files found.
dlls/comdlg32/tests/filedlg.c
View file @
4bbde8fd
...
...
@@ -1034,6 +1034,53 @@ static void test_mru(void)
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
}
static
UINT_PTR
WINAPI
test_extension_wndproc
(
HWND
dlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HWND
parent
=
GetParent
(
dlg
);
if
(
msg
==
WM_NOTIFY
)
{
SetTimer
(
dlg
,
0
,
100
,
0
);
PostMessage
(
parent
,
WM_COMMAND
,
IDOK
,
0
);
}
if
(
msg
==
WM_TIMER
)
{
/* the dialog did not close automatically */
KillTimer
(
dlg
,
0
);
PostMessage
(
parent
,
WM_COMMAND
,
IDCANCEL
,
0
);
}
return
FALSE
;
}
static
void
test_extension
(
void
)
{
OPENFILENAME
ofn
=
{
sizeof
(
OPENFILENAME
)};
char
filename
[
1024
]
=
{
0
};
char
curdir
[
MAX_PATH
];
char
*
filename_ptr
;
const
char
*
test_file_name
=
"deadbeef"
;
DWORD
ret
;
ok
(
GetCurrentDirectoryA
(
sizeof
(
curdir
),
curdir
)
!=
0
,
"Failed to get current dir err %d
\n
"
,
GetLastError
());
/* Ignore .* extension */
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
hwndOwner
=
NULL
;
ofn
.
lpstrFile
=
filename
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLEHOOK
;
ofn
.
lpstrDefExt
=
NULL
;
ofn
.
lpstrInitialDir
=
curdir
;
ofn
.
lpfnHook
=
test_extension_wndproc
;
ofn
.
nFileExtension
=
0
;
ofn
.
lpstrFilter
=
"All Files (*.*)
\0
*.*
\0
"
;
strcpy
(
filename
,
test_file_name
);
ret
=
GetSaveFileNameA
(
&
ofn
);
filename_ptr
=
ofn
.
lpstrFile
+
strlen
(
ofn
.
lpstrFile
)
-
strlen
(
test_file_name
);
ok
(
1
==
ret
,
"expected 1, got %d
\n
"
,
ret
);
ok
(
strlen
(
ofn
.
lpstrFile
)
>=
strlen
(
test_file_name
),
"Filename %s is too short
\n
"
,
ofn
.
lpstrFile
);
ok
(
strcmp
(
filename_ptr
,
test_file_name
)
==
0
,
"Filename is %s, expected %s
\n
"
,
filename_ptr
,
test_file_name
);
}
START_TEST
(
filedlg
)
{
test_DialogCancel
();
...
...
@@ -1045,4 +1092,5 @@ START_TEST(filedlg)
test_getfolderpath
();
test_mru
();
if
(
resizesupported
)
test_resizable2
();
test_extension
();
}
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