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
e3c44185
Commit
e3c44185
authored
Nov 03, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Simplify empty string check (PVS-Studio).
parent
bd6c1662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
26 deletions
+17
-26
path.c
dlls/shlwapi/tests/path.c
+17
-26
No files found.
dlls/shlwapi/tests/path.c
View file @
e3c44185
...
...
@@ -634,8 +634,7 @@ static void test_PathCombineA(void)
ok
(
str
==
NULL
||
broken
(
str
!=
NULL
),
/* Win95 and some W2K */
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
lstrlenA
(
dest
)
==
0
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
ok
(
!
dest
[
0
]
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
"Expected 0 length, got %i
\n
"
,
lstrlenA
(
dest
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -724,8 +723,7 @@ static void test_PathCombineA(void)
lstrcpyA
(
dest
,
"control"
);
str
=
PathCombineA
(
dest
,
"C:
\\
"
,
too_long
);
ok
(
str
==
NULL
,
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
lstrlenA
(
dest
)
==
0
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
ok
(
!
dest
[
0
]
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
"Expected 0 length, got %i
\n
"
,
lstrlenA
(
dest
));
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -734,8 +732,7 @@ static void test_PathCombineA(void)
lstrcpyA
(
dest
,
"control"
);
str
=
PathCombineA
(
dest
,
too_long
,
"one
\\
two
\\
three"
);
ok
(
str
==
NULL
,
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
lstrlenA
(
dest
)
==
0
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
ok
(
!
dest
[
0
]
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
"Expected 0 length, got %i
\n
"
,
lstrlenA
(
dest
));
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -749,8 +746,7 @@ static void test_PathCombineA(void)
lstrcpyA
(
dest
,
"control"
);
str
=
PathCombineA
(
dest
,
one
,
two
);
ok
(
str
==
NULL
,
"Expected str == NULL, got %p
\n
"
,
str
);
ok
(
lstrlenA
(
dest
)
==
0
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
ok
(
!
dest
[
0
]
||
broken
(
!
lstrcmpA
(
dest
,
"control"
)),
/* Win95 and some W2K */
"Expected 0 length, got %i
\n
"
,
lstrlenA
(
dest
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
...
...
@@ -772,7 +768,7 @@ static void test_PathAddBackslash(void)
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
(
!
path
[
0
]
,
"Expected empty string, got %i
\n
"
,
lstrlenA
(
path
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
/* try a relative path */
...
...
@@ -917,8 +913,7 @@ static void test_PathAppendA(void)
res
=
PathAppendA
(
too_long
,
"two
\\
three"
);
ok
(
!
res
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
lstrlenA
(
too_long
)
==
0
||
broken
(
lstrlenA
(
too_long
)
==
(
LONG_LEN
-
1
)),
/* Win95 and some W2K */
ok
(
!
too_long
[
0
]
||
broken
(
lstrlenA
(
too_long
)
==
(
LONG_LEN
-
1
)),
/* Win95 and some W2K */
"Expected length of too_long to be zero, got %i
\n
"
,
lstrlenA
(
too_long
));
/* pszMore is too long */
...
...
@@ -929,8 +924,7 @@ static void test_PathAppendA(void)
res
=
PathAppendA
(
path
,
too_long
);
ok
(
!
res
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
lstrlenA
(
path
)
==
0
||
broken
(
!
lstrcmpA
(
path
,
"C:
\\
one"
)),
/* Win95 and some W2K */
ok
(
!
path
[
0
]
||
broken
(
!
lstrcmpA
(
path
,
"C:
\\
one"
)),
/* Win95 and some W2K */
"Expected length of path to be zero, got %i
\n
"
,
lstrlenA
(
path
));
/* both params combined are too long */
...
...
@@ -941,8 +935,7 @@ static void test_PathAppendA(void)
SetLastError
(
0xdeadbeef
);
res
=
PathAppendA
(
path
,
half
);
ok
(
!
res
,
"Expected failure
\n
"
);
ok
(
lstrlenA
(
path
)
==
0
||
broken
(
lstrlenA
(
path
)
==
(
HALF_LEN
-
1
)),
/* Win95 and some W2K */
ok
(
!
path
[
0
]
||
broken
(
lstrlenA
(
path
)
==
(
HALF_LEN
-
1
)),
/* Win95 and some W2K */
"Expected length of path to be zero, got %i
\n
"
,
lstrlenA
(
path
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
...
...
@@ -1092,7 +1085,7 @@ static void test_PathFindExtensionA(void)
SetLastError
(
0xdeadbeef
);
ext
=
PathFindExtensionA
(
path
);
ok
(
ext
==
path
,
"Expected ext == path, got %p
\n
"
,
ext
);
ok
(
lstrlenA
(
ext
)
==
0
,
"Expected length 0, got %i
\n
"
,
lstrlenA
(
ext
));
ok
(
!
ext
[
0
]
,
"Expected length 0, got %i
\n
"
,
lstrlenA
(
ext
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
/* try a path without an extension */
...
...
@@ -1100,7 +1093,7 @@ static void test_PathFindExtensionA(void)
SetLastError
(
0xdeadbeef
);
ext
=
PathFindExtensionA
(
path
);
ok
(
ext
==
path
+
lstrlenA
(
path
),
"Expected ext == path, got %p
\n
"
,
ext
);
ok
(
lstrlenA
(
ext
)
==
0
,
"Expected length 0, got %i
\n
"
,
lstrlenA
(
ext
));
ok
(
!
ext
[
0
]
,
"Expected length 0, got %i
\n
"
,
lstrlenA
(
ext
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
/* try a path with an extension */
...
...
@@ -1169,8 +1162,7 @@ static void test_PathBuildRootA(void)
lstrcpyA
(
path
,
"aaaaaaaaa"
);
root
=
PathBuildRootA
(
path
,
-
1
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmpA
(
path
,
"aaaaaaaaa"
)
||
lstrlenA
(
path
)
==
0
,
/* Vista */
ok
(
!
lstrcmpA
(
path
,
"aaaaaaaaa"
)
||
!
path
[
0
],
/* Vista */
"Expected aaaaaaaaa or empty string, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -1179,8 +1171,7 @@ static void test_PathBuildRootA(void)
lstrcpyA
(
path
,
"aaaaaaaaa"
);
root
=
PathBuildRootA
(
path
,
26
);
ok
(
root
==
path
,
"Expected root == path, got %p
\n
"
,
root
);
ok
(
!
lstrcmpA
(
path
,
"aaaaaaaaa"
)
||
lstrlenA
(
path
)
==
0
,
/* Vista */
ok
(
!
lstrcmpA
(
path
,
"aaaaaaaaa"
)
||
!
path
[
0
],
/* Vista */
"Expected aaaaaaaaa or empty string, got %s
\n
"
,
path
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -1238,8 +1229,8 @@ static void test_PathCommonPrefixA(void)
lstrcpyA
(
out
,
"aaa"
);
count
=
PathCommonPrefixA
(
path1
,
path2
,
out
);
ok
(
count
==
0
,
"Expected 0, got %i
\n
"
,
count
);
ok
(
lstrlenA
(
out
)
==
0
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
lstrlenA
(
path1
)
==
0
,
"Expected 0 length path1, got %i
\n
"
,
lstrlenA
(
path1
));
ok
(
!
out
[
0
]
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
!
path1
[
0
]
,
"Expected 0 length path1, got %i
\n
"
,
lstrlenA
(
path1
));
ok
(
!
lstrcmpA
(
path2
,
"C:
\\
"
),
"Expected C:
\\
, got %s
\n
"
,
path2
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -1250,8 +1241,8 @@ static void test_PathCommonPrefixA(void)
lstrcpyA
(
out
,
"aaa"
);
count
=
PathCommonPrefixA
(
path1
,
path2
,
out
);
ok
(
count
==
0
,
"Expected 0, got %i
\n
"
,
count
);
ok
(
lstrlenA
(
out
)
==
0
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
lstrlenA
(
path2
)
==
0
,
"Expected 0 length path2, got %i
\n
"
,
lstrlenA
(
path2
));
ok
(
!
out
[
0
]
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
!
path2
[
0
]
,
"Expected 0 length path2, got %i
\n
"
,
lstrlenA
(
path2
));
ok
(
!
lstrcmpA
(
path1
,
"C:
\\
"
),
"Expected C:
\\
, got %s
\n
"
,
path1
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -1406,7 +1397,7 @@ static void test_PathCommonPrefixA(void)
ok
(
count
==
0
,
"Expected 0, got %i
\n
"
,
count
);
ok
(
!
lstrcmpA
(
path1
,
"one
\\
..
\\
two"
),
"Expected one
\\
..
\\
two, got %s
\n
"
,
path1
);
ok
(
!
lstrcmpA
(
path2
,
"two"
),
"Expected two, got %s
\n
"
,
path2
);
ok
(
lstrlenA
(
out
)
==
0
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
!
out
[
0
]
,
"Expected 0 length out, got %i
\n
"
,
lstrlenA
(
out
));
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
}
...
...
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