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
c43bac44
Commit
c43bac44
authored
Jul 18, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Add tests for StrStrA.
parent
ec0e9d0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
string.c
dlls/shlwapi/tests/string.c
+48
-0
No files found.
dlls/shlwapi/tests/string.c
View file @
c43bac44
...
...
@@ -960,6 +960,53 @@ if (0)
win_skip
(
"wnsprintfW() is not available
\n
"
);
}
static
void
test_StrStrA
(
void
)
{
static
const
char
*
deadbeef
=
"DeAdBeEf"
;
const
struct
{
const
char
*
search
;
const
char
*
expect
;
}
StrStrA_cases
[]
=
{
{
""
,
NULL
},
{
"DeAd"
,
deadbeef
},
{
"dead"
,
NULL
},
{
"AdBe"
,
deadbeef
+
2
},
{
"adbe"
,
NULL
},
{
"BeEf"
,
deadbeef
+
4
},
{
"beef"
,
NULL
},
};
LPSTR
ret
;
int
i
;
/* Tests crash on Win9x/Win2k. */
if
(
0
)
{
ret
=
StrStrA
(
NULL
,
NULL
);
ok
(
!
ret
,
"Expected StrStrA to return NULL, got %p
\n
"
,
ret
);
ret
=
StrStrA
(
NULL
,
""
);
ok
(
!
ret
,
"Expected StrStrA to return NULL, got %p
\n
"
,
ret
);
ret
=
StrStrA
(
""
,
NULL
);
ok
(
!
ret
,
"Expected StrStrA to return NULL, got %p
\n
"
,
ret
);
}
ret
=
StrStrA
(
""
,
""
);
ok
(
!
ret
,
"Expected StrStrA to return NULL, got %p
\n
"
,
ret
);
for
(
i
=
0
;
i
<
sizeof
(
StrStrA_cases
)
/
sizeof
(
StrStrA_cases
[
0
]);
i
++
)
{
ret
=
StrStrA
(
deadbeef
,
StrStrA_cases
[
i
].
search
);
ok
(
ret
==
StrStrA_cases
[
i
].
expect
,
"[%d] Expected StrStrA to return %p, got %p
\n
"
,
i
,
StrStrA_cases
[
i
].
expect
,
ret
);
}
}
START_TEST
(
string
)
{
HMODULE
hShlwapi
;
...
...
@@ -1029,6 +1076,7 @@ START_TEST(string)
test_SHAnsiToAnsi
();
test_SHUnicodeToUnicode
();
test_StrXXX_overflows
();
test_StrStrA
();
CoUninitialize
();
}
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