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
960104b2
Commit
960104b2
authored
Apr 22, 2004
by
Jakob Eriksson
Committed by
Alexandre Julliard
Apr 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When the Windows directory was something else than C:\WINDOWS
test_GetTempFileNameA() failed.
parent
1fb75dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
file.c
dlls/kernel/tests/file.c
+31
-11
No files found.
dlls/kernel/tests/file.c
View file @
960104b2
...
...
@@ -628,22 +628,42 @@ static void test_CreateFileW(void)
"CreateFileW(
\"\"
) returned ret=%p error=%ld
\n
"
,
hFile
,
GetLastError
());
}
static
void
test_GetTempFileNameA
()
{
static
void
test_GetTempFileNameA
()
{
UINT
result
;
char
out
[
MAX_PATH
];
char
*
expected
=
"c:
\\
windows
\\
abc2.tmp"
;
char
expected
[
MAX_PATH
+
10
];
char
windowsdir
[
MAX_PATH
+
10
];
char
windowsdrive
[
3
];
/* this test may depend on the config file settings */
result
=
GetTempFileNameA
(
"C:"
,
"abc"
,
1
,
out
);
ok
(
result
!=
0
,
"GetTempFileNameA: error %ld
\n
"
,
GetLastError
()
);
ok
(
((
out
[
0
]
==
'C'
)
&&
(
out
[
1
]
==
':'
))
&&
(
out
[
2
]
==
'\\'
),
"GetTempFileNameA: first three characters should be C:
\\
, string was actually %s
\n
"
,
out
);
result
=
GetWindowsDirectory
(
windowsdir
,
sizeof
(
windowsdir
));
ok
(
result
<
sizeof
(
windowsdir
),
"windowsdir is abnormally long!
\n
"
);
ok
(
result
!=
0
,
"GetWindowsDirectory: error %ld
\n
"
,
GetLastError
());
result
=
GetTempFileNameA
(
"c:
\\
windows
\\
"
,
"abc"
,
2
,
out
);
ok
(
result
!=
0
,
"GetTempFileNameA: error %ld
\n
"
,
GetLastError
()
);
ok
(
lstrcmpiA
(
out
,
expected
)
==
0
,
"GetTempFileNameA: Unexpected output
\"
%s
\"
vs
\"
%s
\"\n
"
,
out
,
expected
);
}
/* If the Windows directory is the root directory, it ends in backslash, not else. */
if
(
strlen
(
windowsdir
)
!=
3
)
/* As in "C:\" or "F:\" */
{
strcat
(
windowsdir
,
"
\\
"
);
}
windowsdrive
[
0
]
=
windowsdir
[
0
];
windowsdrive
[
1
]
=
windowsdir
[
1
];
windowsdrive
[
2
]
=
'\0'
;
result
=
GetTempFileNameA
(
windowsdrive
,
"abc"
,
1
,
out
);
ok
(
result
!=
0
,
"GetTempFileNameA: error %ld
\n
"
,
GetLastError
());
ok
(((
out
[
0
]
==
windowsdrive
[
0
])
&&
(
out
[
1
]
==
':'
))
&&
(
out
[
2
]
==
'\\'
),
"GetTempFileNameA: first three characters should be %c:
\\
, string was actually %s
\n
"
,
windowsdrive
[
0
],
out
);
result
=
GetTempFileNameA
(
windowsdir
,
"abc"
,
2
,
out
);
ok
(
result
!=
0
,
"GetTempFileNameA: error %ld
\n
"
,
GetLastError
());
expected
[
0
]
=
'\0'
;
strcat
(
expected
,
windowsdir
);
strcat
(
expected
,
"abc2.tmp"
);
ok
(
lstrcmpiA
(
out
,
expected
)
==
0
,
"GetTempFileNameA: Unexpected output
\"
%s
\"
vs
\"
%s
\"\n
"
,
out
,
expected
);
}
static
void
test_DeleteFileA
(
void
)
{
...
...
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