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
00658a4a
Commit
00658a4a
authored
Nov 29, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added mbrlen tests.
parent
b8ee0dd7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
string.c
dlls/msvcrt/tests/string.c
+18
-0
No files found.
dlls/msvcrt/tests/string.c
View file @
00658a4a
...
...
@@ -23,6 +23,7 @@
#include "winnls.h"
#include <string.h>
#include <mbstring.h>
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <mbctype.h>
...
...
@@ -84,6 +85,7 @@ static errno_t (__cdecl *p_mbsupr_s)(unsigned char *str, size_t numberOfElements
static
errno_t
(
__cdecl
*
p_mbslwr_s
)(
unsigned
char
*
str
,
size_t
numberOfElements
);
static
int
(
__cdecl
*
p_wctob
)(
wint_t
);
static
int
(
__cdecl
*
p_tolower
)(
int
);
static
size_t
(
__cdecl
*
p_mbrlen
)(
const
char
*
,
size_t
,
mbstate_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)
...
...
@@ -304,6 +306,21 @@ 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 */
/* mbrlen */
if
(
!
setlocale
(
LC_ALL
,
".936"
)
||
!
p_mbrlen
)
{
win_skip
(
"mbrlen tests
\n
"
);
}
else
{
mbstate_t
state
=
0
;
expect_eq
(
p_mbrlen
((
const
char
*
)
mbstring
,
2
,
NULL
),
2
,
int
,
"%d"
);
expect_eq
(
p_mbrlen
((
const
char
*
)
&
mbstring
[
2
],
2
,
NULL
),
2
,
int
,
"%d"
);
expect_eq
(
p_mbrlen
((
const
char
*
)
&
mbstring
[
3
],
2
,
NULL
),
1
,
int
,
"%d"
);
expect_eq
(
p_mbrlen
((
const
char
*
)
mbstring
,
1
,
NULL
),
-
2
,
int
,
"%d"
);
expect_eq
(
p_mbrlen
((
const
char
*
)
mbstring
,
1
,
&
state
),
-
2
,
int
,
"%d"
);
ok
(
state
==
mbstring
[
0
],
"incorrect state value (%x)
\n
"
,
state
);
expect_eq
(
p_mbrlen
((
const
char
*
)
&
mbstring
[
1
],
1
,
&
state
),
2
,
int
,
"%d"
);
}
setlocale
(
LC_ALL
,
"C"
);
/* _mbccpy/_mbsncpy */
memset
(
buf
,
0xff
,
sizeof
(
buf
));
_mbccpy
(
buf
,
mbstring
);
...
...
@@ -2302,6 +2319,7 @@ START_TEST(string)
p_mbslwr_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbslwr_s"
);
p_wctob
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wctob"
);
p_tolower
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"tolower"
);
p_mbrlen
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"mbrlen"
);
/* 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