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
f38c958e
Commit
f38c958e
authored
Oct 05, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Add _mbsnlen tests.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f097c2be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
string.c
dlls/msvcrt/tests/string.c
+16
-0
No files found.
dlls/msvcrt/tests/string.c
View file @
f38c958e
...
...
@@ -96,6 +96,7 @@ static double (__cdecl *p__atof_l)(const char*,_locale_t);
static
double
(
__cdecl
*
p__strtod_l
)(
const
char
*
,
char
**
,
_locale_t
);
static
int
(
__cdecl
*
p__strnset_s
)(
char
*
,
size_t
,
int
,
size_t
);
static
int
(
__cdecl
*
p__wcsset_s
)(
wchar_t
*
,
size_t
,
wchar_t
);
static
size_t
(
__cdecl
*
p__mbsnlen
)(
const
unsigned
char
*
,
size_t
);
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
#define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
...
...
@@ -316,6 +317,20 @@ static void test_mbcp(void)
expect_eq
(
_mbslen
(
mbsonlylead
),
0
,
int
,
"%d"
);
/* lead + NUL not counted as character */
expect_eq
(
_mbslen
(
mbstring
),
4
,
int
,
"%d"
);
/* lead + invalid trail counted */
if
(
!
p__mbsnlen
)
{
win_skip
(
"_mbsnlen tests
\n
"
);
}
else
{
expect_eq
(
p__mbsnlen
(
mbstring
,
8
),
8
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbstring
,
9
),
4
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbstring
,
10
),
4
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbsonlylead
,
0
),
0
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbsonlylead
,
1
),
1
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbsonlylead
,
2
),
0
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbstring2
,
7
),
7
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbstring2
,
8
),
4
,
int
,
"%d"
);
expect_eq
(
p__mbsnlen
(
mbstring2
,
9
),
4
,
int
,
"%d"
);
}
/* mbrlen */
if
(
!
setlocale
(
LC_ALL
,
".936"
)
||
!
p_mbrlen
)
{
win_skip
(
"mbrlen tests
\n
"
);
...
...
@@ -3270,6 +3285,7 @@ START_TEST(string)
p__strtod_l
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_strtod_l"
);
p__strnset_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_strnset_s"
);
p__wcsset_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_wcsset_s"
);
p__mbsnlen
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnlen"
);
/* MSVCRT memcpy behaves like memmove for overlapping moves,
MFC42 CString::Insert seems to rely on that behaviour */
...
...
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