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
e8c2ac2d
Commit
e8c2ac2d
authored
May 13, 2003
by
Francois Gouget
Committed by
Alexandre Julliard
May 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for GetLongPathNameA("c:").
Added a test for GetFullPathNameA("c:"). Fix a number of messages that referred to GetLongPathName instead of GetFullPathName.
parent
fe0bae39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
12 deletions
+29
-12
path.c
dlls/kernel/tests/path.c
+29
-12
No files found.
dlls/kernel/tests/path.c
View file @
e8c2ac2d
...
...
@@ -514,6 +514,14 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
ok
(
rc
==
strlen
(
tmpstr
)
+
1
,
"GetLongPathNameA: wrong return code, %ld instead of %d"
,
rc
,
strlen
(
curdir
)
+
1
);
todo_wine
{
sprintf
(
dir
,
"%c:"
,
curDrive
);
rc
=
(
*
pGetLongPathNameA
)(
dir
,
tmpstr
,
sizeof
(
tmpstr
));
ok
(
strcmp
(
dir
,
tmpstr
)
==
0
,
"GetLongPathNameA: returned '%s' instead of '%s' (rc=%ld)"
,
tmpstr
,
dir
,
rc
);
}
}
/* Check the cases where both file and directory exist first */
...
...
@@ -684,30 +692,39 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
}
/* Test GetFullPathNameA with drive letters */
if
(
curDrive
!=
NOT_A_VALID_DRIVE
)
{
sprintf
(
tmpstr
,
"%c:"
,
curdir
[
0
]);
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr2
,
&
strptr
),
"GetFullPathNameA(%c:) failed"
,
curdir
[
0
]);
GetCurrentDirectoryA
(
MAX_PATH
,
tmpstr
);
sprintf
(
tmpstr1
,
"%s
\\
"
,
tmpstr
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr2
)
==
0
||
lstrcmpiA
(
tmpstr1
,
tmpstr2
)
==
0
,
"GetFullPathNameA(%c:) returned '%s' instead of '%s' or '%s'"
,
curdir
[
0
],
tmpstr2
,
tmpstr
,
tmpstr1
);
sprintf
(
tmpstr
,
"%c:
\\
%s
\\
%s"
,
curDrive
,
SHORTDIR
,
SHORTFILE
);
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr1
,
&
strptr
),
"GetFullPathNameA failed"
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"Get
Long
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"Get
Full
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
}
/* Without a leading slash, insert the current directory if on the current drive */
sprintf
(
tmpstr
,
"%c:%s
\\
%s"
,
curdir
[
0
],
SHORTDIR
,
SHORTFILE
);
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr1
,
&
strptr
),
"GetFullPathNameA failed"
);
sprintf
(
tmpstr
,
"%s
\\
%s
\\
%s"
,
curdir
,
SHORTDIR
,
SHORTFILE
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"Get
Long
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"Get
Full
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
/* Otherwise insert the missing leading slash */
if
(
otherDrive
!=
NOT_A_VALID_DRIVE
)
{
sprintf
(
tmpstr
,
"%c:%s
\\
%s"
,
otherDrive
,
SHORTDIR
,
SHORTFILE
);
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr1
,
&
strptr
),
"GetFullPathNameA failed for %s"
,
tmpstr
);
sprintf
(
tmpstr
,
"%c:
\\
%s
\\
%s"
,
otherDrive
,
SHORTDIR
,
SHORTFILE
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"Get
Long
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"Get
Full
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
}
/* Xilinx tools like to mix Unix and DOS formats, which Windows handles fine.
So test for them. */
...
...
@@ -716,18 +733,18 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr1
,
&
strptr
),
"GetFullPathNameA failed"
);
sprintf
(
tmpstr
,
"%c:
\\
%s
\\
%s"
,
curDrive
,
SHORTDIR
,
SHORTFILE
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"Get
Long
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"Get
Full
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
}
/**/
sprintf
(
tmpstr
,
"%c:%s/%s"
,
curdir
[
0
],
SHORTDIR
,
SHORTFILE
);
ok
(
GetFullPathNameA
(
tmpstr
,
MAX_PATH
,
tmpstr1
,
&
strptr
),
"GetFullPathNameA failed"
);
sprintf
(
tmpstr
,
"%s
\\
%s
\\
%s"
,
curdir
,
SHORTDIR
,
SHORTFILE
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"Get
Long
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"Get
Full
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
/* Windows will insert a drive letter in front of an absolute UNIX path, but
Wine probably shouldn't. */
sprintf
(
tmpstr
,
"/%s/%s"
,
SHORTDIR
,
SHORTFILE
);
...
...
@@ -736,12 +753,12 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
if
(
curDrive
!=
NOT_A_VALID_DRIVE
)
{
sprintf
(
tmpstr
,
"C:
\\
%s
\\
%s"
,
SHORTDIR
,
SHORTFILE
);
ok
(
lstrcmpiA
(
tmpstr
,
tmpstr1
)
==
0
,
"GetLong
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
"GetFull
PathNameA returned '%s' instead of '%s'"
,
tmpstr1
,
tmpstr
);
}
}
/* This passes in Wine because it still contains the pointer from the previous test */
ok
(
lstrcmpiA
(
SHORTFILE
,
strptr
)
==
0
,
"Get
Long
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
"Get
Full
PathNameA returned part '%s' instead of '%s'"
,
strptr
,
SHORTFILE
);
/* Now try some relative paths */
ok
(
GetShortPathNameA
(
LONGDIR
,
tmpstr
,
MAX_PATH
),
"GetShortPathNameA failed"
);
...
...
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