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
a6f4ede2
Commit
a6f4ede2
authored
Jul 12, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Jul 13, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Add tests for PathBuildRootA.
parent
094915ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
path.c
dlls/shlwapi/tests/path.c
+55
-0
No files found.
dlls/shlwapi/tests/path.c
View file @
a6f4ede2
...
...
@@ -1485,6 +1485,60 @@ static void test_PathFindExtensionA(void)
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
static
void
test_PathBuildRootA
(
void
)
{
LPSTR
root
;
char
path
[
10
];
char
root_expected
[
26
][
4
];
char
drive
;
int
j
;
/* set up the expected paths */
for
(
drive
=
'A'
;
drive
<=
'Z'
;
drive
++
)
sprintf
(
root_expected
[
drive
-
'A'
],
"%c:
\\
"
,
drive
);
/* test the expected values */
for
(
j
=
0
;
j
<
26
;
j
++
)
{
SetLastError
(
0xdeadbeef
);
lstrcpy
(
path
,
"aaaaaaaaa"
);
root
=
PathBuildRootA
(
path
,
j
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmp
(
root
,
root_expected
[
j
]),
"Expected %s, got %s
\n
"
,
root_expected
[
j
],
root
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
/* test a negative drive number */
SetLastError
(
0xdeadbeef
);
lstrcpy
(
path
,
"aaaaaaaaa"
);
root
=
PathBuildRootA
(
path
,
-
1
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmp
(
path
,
"aaaaaaaaa"
),
"Expected aaaaaaaaa, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* test a drive number greater than 25 */
SetLastError
(
0xdeadbeef
);
lstrcpy
(
path
,
"aaaaaaaaa"
);
root
=
PathBuildRootA
(
path
,
26
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmp
(
path
,
"aaaaaaaaa"
),
"Expected aaaaaaaaa, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* length of path is less than 4 */
SetLastError
(
0xdeadbeef
);
lstrcpy
(
path
,
"aa"
);
root
=
PathBuildRootA
(
path
,
0
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmp
(
path
,
"A:
\\
"
),
"Expected A:
\\
, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* path is NULL */
SetLastError
(
0xdeadbeef
);
root
=
PathBuildRootA
(
NULL
,
0
);
ok
(
root
==
NULL
,
"Expected root == NULL, got %p
\n
"
,
root
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
START_TEST
(
path
)
{
hShlwapi
=
LoadLibraryA
(
"shlwapi.dll"
);
...
...
@@ -1527,4 +1581,5 @@ START_TEST(path)
test_PathAppendA
();
test_PathCanonicalizeA
();
test_PathFindExtensionA
();
test_PathBuildRootA
();
}
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