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
1b7a3dae
Commit
1b7a3dae
authored
Jul 28, 2010
by
Andrew Eikum
Committed by
Alexandre Julliard
Jul 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32/tests: Use GetOpenFileNameA instead of GetOpenFileNameW.
parent
7c1124e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
28 deletions
+18
-28
filedlg.c
dlls/comdlg32/tests/filedlg.c
+18
-28
No files found.
dlls/comdlg32/tests/filedlg.c
View file @
1b7a3dae
...
@@ -988,59 +988,49 @@ static void test_resizable2(void)
...
@@ -988,59 +988,49 @@ static void test_resizable2(void)
static
void
test_mru
(
void
)
static
void
test_mru
(
void
)
{
{
ok_wndproc_testcase
testcase
=
{
0
};
ok_wndproc_testcase
testcase
=
{
0
};
OPENFILENAMEW
ofn
=
{
sizeof
(
OPENFILENAMEW
)};
OPENFILENAME
ofn
=
{
sizeof
(
OPENFILENAME
)};
const
char
*
test_dir_nameA
=
"C:
\\
mru_test"
;
const
char
*
test_dir_name
=
"C:
\\
mru_test"
;
const
WCHAR
test_file_name
[]
=
const
char
*
test_file_name
=
"test.txt"
;
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
const
char
*
test_full_path
=
"C:
\\
mru_test
\\
test.txt"
;
const
WCHAR
test_full_path
[]
=
char
filename_buf
[
MAX_PATH
];
{
'C'
,
':'
,
'\\'
,
'm'
,
'r'
,
'u'
,
'_'
,
't'
,
'e'
,
's'
,
't'
,
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
const
WCHAR
template1W
[]
=
{
't'
,
'e'
,
'm'
,
'p'
,
'l'
,
'a'
,
't'
,
'e'
,
'1'
,
0
};
WCHAR
filename_buf
[
MAX_PATH
];
DWORD
ret
;
DWORD
ret
;
ofn
.
lpstrFile
=
filename_buf
;
ofn
.
lpstrFile
=
filename_buf
;
ofn
.
nMaxFile
=
sizeof
(
filename_buf
);
ofn
.
nMaxFile
=
sizeof
(
filename_buf
);
ofn
.
lpTemplateName
=
template1W
;
ofn
.
lpTemplateName
=
"template1"
;
ofn
.
hInstance
=
GetModuleHandle
(
NULL
);
ofn
.
hInstance
=
GetModuleHandle
(
NULL
);
ofn
.
Flags
=
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
|
OFN_NOCHANGEDIR
;
ofn
.
Flags
=
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
|
OFN_NOCHANGEDIR
;
ofn
.
lCustData
=
(
LPARAM
)
&
testcase
;
ofn
.
lCustData
=
(
LPARAM
)
&
testcase
;
ofn
.
lpfnHook
=
(
LPOFNHOOKPROC
)
test_ok_wndproc
;
ofn
.
lpfnHook
=
(
LPOFNHOOKPROC
)
test_ok_wndproc
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
CreateDirectoryA
(
test_dir_name
A
,
NULL
);
ret
=
CreateDirectoryA
(
test_dir_name
,
NULL
);
ok
(
ret
==
TRUE
,
"CreateDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
==
TRUE
,
"CreateDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
/* "teach" comdlg32 about this directory */
/* "teach" comdlg32 about this directory */
lstrcpyW
(
filename_buf
,
test_full_path
);
strcpy
(
filename_buf
,
test_full_path
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetOpenFileNameW
(
&
ofn
);
ret
=
GetOpenFileNameA
(
&
ofn
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
){
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %d
\n
"
,
GetLastError
());
win_skip
(
"Platform doesn't implement GetOpenFileNameW
\n
"
);
RemoveDirectoryA
(
test_dir_nameA
);
return
;
}
ok
(
ret
,
"GetOpenFileNameW should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
ret
=
CommDlgExtendedError
();
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
ok
(
!
lstrcmpW
(
ofn
.
lpstrFile
,
test_full_path
),
"Expected to get %s, got %s
\n
"
,
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
wine_dbgstr_w
(
test_full_path
),
wine_dbgstr_w
(
ofn
.
lpstrFile
)
);
ok
(
!
strcmp
(
ofn
.
lpstrFile
,
test_full_path
),
"Expected to get %s, got %s
\n
"
,
test_full_path
,
ofn
.
lpstrFile
);
/* get a filename without a full path. it should return the file in
/* get a filename without a full path. it should return the file in
* test_dir_name, not in the CWD */
* test_dir_name, not in the CWD */
lstrcpyW
(
filename_buf
,
test_file_name
);
strcpy
(
filename_buf
,
test_file_name
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetOpenFileNameW
(
&
ofn
);
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
,
"GetOpenFileNameW should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
ret
=
CommDlgExtendedError
();
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
if
(
lstrcmpW
(
ofn
.
lpstrFile
,
test_full_path
)
!=
0
)
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
if
(
strcmp
(
ofn
.
lpstrFile
,
test_full_path
)
!=
0
)
win_skip
(
"Platform doesn't save MRU data
\n
"
);
win_skip
(
"Platform doesn't save MRU data
\n
"
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
RemoveDirectoryA
(
test_dir_name
A
);
ret
=
RemoveDirectoryA
(
test_dir_name
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
}
}
...
...
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