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
857ff080
Commit
857ff080
authored
Jul 19, 2007
by
Anatoly Lyutin
Committed by
Alexandre Julliard
Jul 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add test for GetShortPathNameW.
parent
2364a87d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
path.c
dlls/kernel32/tests/path.c
+35
-0
No files found.
dlls/kernel32/tests/path.c
View file @
857ff080
...
...
@@ -961,6 +961,40 @@ static void test_GetLongPathNameW(void)
}
}
static
void
test_GetShortPathNameW
(
void
)
{
WCHAR
test_path
[]
=
{
'L'
,
'o'
,
'n'
,
'g'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
WCHAR
path
[
MAX_PATH
];
WCHAR
short_path
[
MAX_PATH
];
DWORD
length
;
HANDLE
file
;
int
ret
;
WCHAR
name
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
WCHAR
backSlash
[]
=
{
'\\'
,
0
};
GetTempPathW
(
MAX_PATH
,
path
);
lstrcatW
(
path
,
test_path
);
lstrcatW
(
path
,
backSlash
);
ret
=
CreateDirectoryW
(
path
,
NULL
);
ok
(
ret
,
"Directory was not created. LastError = %d
\n
"
,
GetLastError
()
);
/* Starting a main part of test */
length
=
GetShortPathNameW
(
path
,
short_path
,
0
);
ok
(
length
,
"GetShortPathNameW returned 0.
\n
"
);
ret
=
GetShortPathNameW
(
path
,
short_path
,
length
);
ok
(
ret
,
"GetShortPathNameW returned 0.
\n
"
);
lstrcatW
(
short_path
,
name
);
file
=
CreateFileW
(
short_path
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"File was not created.
\n
"
);
/* End test */
CloseHandle
(
file
);
ret
=
DeleteFileW
(
short_path
);
ok
(
ret
,
"Can not delete file.
\n
"
);
ret
=
RemoveDirectoryW
(
path
);
ok
(
ret
,
"Can not delete directory.
\n
"
);
}
static
void
test_GetSystemDirectory
(
void
)
{
CHAR
buffer
[
MAX_PATH
+
4
];
...
...
@@ -1136,6 +1170,7 @@ START_TEST(path)
test_CleanupPathA
(
origdir
,
curdir
);
test_GetTempPath
();
test_GetLongPathNameW
();
test_GetShortPathNameW
();
test_GetSystemDirectory
();
test_GetWindowsDirectory
();
if
(
pNeedCurrentDirectoryForExePathA
)
...
...
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