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
4befefa9
Commit
4befefa9
authored
Oct 29, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetLongPathName/GetShortPathName and relative paths.
parent
454243aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
path.c
dlls/kernel32/tests/path.c
+67
-0
No files found.
dlls/kernel32/tests/path.c
View file @
4befefa9
...
...
@@ -1930,6 +1930,72 @@ static void init_pointers(void)
#undef MAKEFUNC
}
static
void
test_relative_path
(
void
)
{
char
path
[
MAX_PATH
],
buf
[
MAX_PATH
];
HANDLE
file
;
int
ret
;
if
(
!
pGetLongPathNameA
)
return
;
GetTempPathA
(
MAX_PATH
,
path
);
ret
=
SetCurrentDirectoryA
(
path
);
ok
(
ret
,
"SetCurrentDirectory error %d
\n
"
,
GetLastError
());
ret
=
CreateDirectoryA
(
"foo"
,
NULL
);
ok
(
ret
,
"CreateDirectory error %d
\n
"
,
GetLastError
());
file
=
CreateFileA
(
"foo
\\
file"
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"failed to create temp file
\n
"
);
CloseHandle
(
file
);
ret
=
CreateDirectoryA
(
"bar"
,
NULL
);
ok
(
ret
,
"CreateDirectory error %d
\n
"
,
GetLastError
());
ret
=
SetCurrentDirectoryA
(
"bar"
);
ok
(
ret
,
"SetCurrentDirectory error %d
\n
"
,
GetLastError
());
ret
=
GetFileAttributesA
(
"..
\\
foo
\\
file"
);
ok
(
ret
!=
INVALID_FILE_ATTRIBUTES
,
"GetFileAttributes error %d
\n
"
,
GetLastError
());
strcpy
(
buf
,
"deadbeef"
);
ret
=
pGetLongPathNameA
(
"."
,
buf
,
MAX_PATH
);
ok
(
ret
,
"GetLongPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
"."
),
"expected ., got %s
\n
"
,
buf
);
strcpy
(
buf
,
"deadbeef"
);
ret
=
GetShortPathNameA
(
"."
,
buf
,
MAX_PATH
);
ok
(
ret
,
"GetShortPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
"."
),
"expected ., got %s
\n
"
,
buf
);
strcpy
(
buf
,
"deadbeef"
);
ret
=
pGetLongPathNameA
(
".."
,
buf
,
MAX_PATH
);
ok
(
ret
,
"GetLongPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
".."
),
"expected .., got %s
\n
"
,
buf
);
strcpy
(
buf
,
"deadbeef"
);
ret
=
GetShortPathNameA
(
".."
,
buf
,
MAX_PATH
);
ok
(
ret
,
"GetShortPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
".."
),
"expected .., got %s
\n
"
,
buf
);
strcpy
(
buf
,
"deadbeef"
);
ret
=
pGetLongPathNameA
(
"..
\\
foo
\\
file"
,
buf
,
MAX_PATH
);
todo_wine
ok
(
ret
,
"GetLongPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
"..
\\
foo
\\
file"
),
"expected ..
\\
foo
\\
file, got %s
\n
"
,
buf
);
strcpy
(
buf
,
"deadbeef"
);
ret
=
GetShortPathNameA
(
"..
\\
foo
\\
file"
,
buf
,
MAX_PATH
);
todo_wine
ok
(
ret
,
"GetShortPathName error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
buf
,
"..
\\
foo
\\
file"
),
"expected ..
\\
foo
\\
file, got %s
\n
"
,
buf
);
SetCurrentDirectoryA
(
".."
);
DeleteFileA
(
"foo
\\
file"
);
RemoveDirectoryA
(
"foo"
);
RemoveDirectoryA
(
"bar"
);
}
START_TEST
(
path
)
{
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
],
curDrive
,
otherDrive
;
...
...
@@ -1944,6 +2010,7 @@ START_TEST(path)
if
(
!
pActivateActCtx
)
win_skip
(
"Activation contexts not supported, some tests will be skipped
\n
"
);
test_relative_path
();
test_InitPathA
(
curdir
,
&
curDrive
,
&
otherDrive
);
test_CurrentDirectoryA
(
origdir
,
curdir
);
test_PathNameA
(
curdir
,
curDrive
,
otherDrive
);
...
...
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