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
251d7688
Commit
251d7688
authored
Jun 26, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Jun 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Add tests for PathAddBackslash.
parent
7412bddd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
path.c
dlls/shlwapi/tests/path.c
+63
-0
No files found.
dlls/shlwapi/tests/path.c
View file @
251d7688
...
...
@@ -1072,6 +1072,68 @@ static void test_PathCombineA(void)
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
static
void
test_PathAddBackslash
(
void
)
{
LPSTR
str
;
char
path
[
MAX_PATH
];
char
too_long
[
LONG_LEN
];
/* try a NULL path */
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
NULL
);
ok
(
str
==
NULL
,
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* try an empty path */
path
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
path
);
ok
(
str
==
(
path
+
lstrlenA
(
path
)),
"Expected str to point to end of path, got %p
\n
"
,
str
);
ok
(
lstrlenA
(
path
)
==
0
,
"Expected empty string, got %i
\n
"
,
lstrlenA
(
path
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* try a relative path */
lstrcpyA
(
path
,
"one
\\
two"
);
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
path
);
ok
(
str
==
(
path
+
lstrlenA
(
path
)),
"Expected str to point to end of path, got %p
\n
"
,
str
);
ok
(
!
lstrcmp
(
path
,
"one
\\
two
\\
"
),
"Expected one
\\
two
\\
, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* try periods */
lstrcpyA
(
path
,
"one
\\
..
\\
two"
);
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
path
);
ok
(
str
==
(
path
+
lstrlenA
(
path
)),
"Expected str to point to end of path, got %p
\n
"
,
str
);
ok
(
!
lstrcmp
(
path
,
"one
\\
..
\\
two
\\
"
),
"Expected one
\\
..
\\
two
\\
, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* try just a space */
lstrcpyA
(
path
,
" "
);
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
path
);
ok
(
str
==
(
path
+
lstrlenA
(
path
)),
"Expected str to point to end of path, got %p
\n
"
,
str
);
ok
(
!
lstrcmp
(
path
,
"
\\
"
),
"Expected
\\
, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* path already has backslash */
lstrcpyA
(
path
,
"C:
\\
one
\\
"
);
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
path
);
ok
(
str
==
(
path
+
lstrlenA
(
path
)),
"Expected str to point to end of path, got %p
\n
"
,
str
);
ok
(
!
lstrcmp
(
path
,
"C:
\\
one
\\
"
),
"Expected C:
\\
one
\\
, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
memset
(
too_long
,
'a'
,
LONG_LEN
);
too_long
[
LONG_LEN
-
1
]
=
'\0'
;
/* path is longer than MAX_PATH */
SetLastError
(
0xdeadbeef
);
str
=
PathAddBackslashA
(
too_long
);
ok
(
str
==
NULL
,
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
START_TEST
(
path
)
{
hShlwapi
=
LoadLibraryA
(
"shlwapi.dll"
);
...
...
@@ -1090,6 +1152,7 @@ START_TEST(path)
test_PathCreateFromUrl
();
test_PathIsUrl
();
test_PathAddBackslash
();
test_PathMakePretty
();
test_PathMatchSpec
();
...
...
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