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
933bcb92
Commit
933bcb92
authored
Oct 17, 2010
by
Louis Lenders
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add some more tests for GetTempFileName.
parent
365e7244
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
path.c
dlls/kernel32/tests/path.c
+23
-6
No files found.
dlls/kernel32/tests/path.c
View file @
933bcb92
...
...
@@ -310,11 +310,14 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
{
CHAR
tmppath
[
MAX_PATH
],
/*path to TEMP */
tmpstr
[
MAX_PATH
],
tmpstr1
[
MAX_PATH
];
tmpstr1
[
MAX_PATH
],
invalid_dir
[
MAX_PATH
];
DWORD
len
,
len1
,
drives
;
INT
id
;
HANDLE
hndl
;
BOOL
bRes
;
UINT
unique
;
*
curDrive
=
*
otherDrive
=
NOT_A_VALID_DRIVE
;
...
...
@@ -334,11 +337,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
ok
(
len1
==
len
+
1
||
broken
(
len1
==
len
),
/* WinME */
"GetTempPathA should return string length %d instead of %d
\n
"
,
len
+
1
,
len1
);
/* Test GetTmpFileNameA
The only test we do here is whether GetTempFileNameA passes or not.
We do not thoroughly test this function yet (specifically, whether
it behaves correctly when 'unique' is non zero)
*/
/* Test GetTmpFileNameA */
ok
((
id
=
GetTempFileNameA
(
tmppath
,
"path"
,
0
,
newdir
)),
"GetTempFileNameA failed
\n
"
);
sprintf
(
tmpstr
,
"pat%.4x.tmp"
,
id
&
0xffff
);
sprintf
(
tmpstr1
,
"pat%x.tmp"
,
id
&
0xffff
);
...
...
@@ -361,6 +360,24 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
ok
(
DeleteFileA
(
newdir
),
"Couldn't delete the temporary file we just created
\n
"
);
}
for
(
unique
=
0
;
unique
<
3
;
unique
++
)
{
/* Non-existent path */
sprintf
(
invalid_dir
,
"%s\%s"
,
tmppath
,
"non_existent_dir_1jwj3y32nb3"
);
SetLastError
(
0xdeadbeef
);
todo_wine
ok
(
!
GetTempFileNameA
(
invalid_dir
,
"tfn"
,
unique
,
newdir
),
"GetTempFileNameA should have failed
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_DIRECTORY
||
broken
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
)
/*win98*/
,
"got %d, expected ERROR_DIRECTORY
\n
"
,
GetLastError
());
/* Check return value for unique !=0 */
if
(
unique
)
{
ok
((
GetTempFileNameA
(
tmppath
,
"tfn"
,
unique
,
newdir
)
==
unique
),
"GetTempFileNameA unexpectedly failed
\n
"
);
/* if unique != 0, the actual temp files are not created: */
ok
(
!
DeleteFileA
(
newdir
)
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Deleted a file that shouldn't exist!
\n
"
);
}
}
/* Find first valid drive letter that is neither newdir[0] nor curDrive */
drives
=
GetLogicalDrives
()
&
~
(
1
<<
(
newdir
[
0
]
-
'A'
));
if
(
*
curDrive
!=
NOT_A_VALID_DRIVE
)
...
...
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