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
eb13a49d
Commit
eb13a49d
authored
Jun 21, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add some _mbstok tests.
parent
779c1f80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+5
-0
string.c
dlls/msvcrt/tests/string.c
+19
-0
No files found.
dlls/msvcr90/tests/msvcr90.c
View file @
eb13a49d
...
...
@@ -93,6 +93,7 @@ static __msvcrt_ulong* (__cdecl *p_doserrno)(void);
static
void
(
__cdecl
*
p_srand
)(
unsigned
int
);
static
char
*
(
__cdecl
*
p_strtok
)(
char
*
,
const
char
*
);
static
wchar_t
*
(
__cdecl
*
p_wcstok
)(
wchar_t
*
,
const
wchar_t
*
);
static
unsigned
char
*
(
__cdecl
*
p__mbstok
)(
unsigned
char
*
,
const
unsigned
char
*
);
static
char
*
(
__cdecl
*
p_strerror
)(
int
);
static
wchar_t
*
(
__cdecl
*
p_wcserror
)(
int
);
static
char
*
(
__cdecl
*
p_tmpnam
)(
char
*
);
...
...
@@ -279,6 +280,7 @@ static BOOL init(void)
SET
(
p_srand
,
"srand"
);
SET
(
p_strtok
,
"strtok"
);
SET
(
p_wcstok
,
"wcstok"
);
SET
(
p__mbstok
,
"_mbstok"
);
SET
(
p_strerror
,
"strerror"
);
SET
(
p_wcserror
,
"_wcserror"
);
SET
(
p_tmpnam
,
"tmpnam"
);
...
...
@@ -1038,6 +1040,7 @@ static void test_getptd(void)
DWORD
tid
=
GetCurrentThreadId
();
wchar_t
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
},
tW
[]
=
{
't'
,
0
},
*
wp
;
char
test
[]
=
"test"
,
*
p
;
unsigned
char
mbstok_test
[]
=
"test"
,
*
up
;
struct
tm
time
;
__time64_t
secs
=
0
;
int
dec
,
sign
;
...
...
@@ -1053,6 +1056,8 @@ static void test_getptd(void)
ok
(
ptd
->
strtok_next
==
p
+
3
,
"ptd->strtok_next is incorrect
\n
"
);
wp
=
p_wcstok
(
testW
,
tW
);
ok
(
ptd
->
wcstok_next
==
wp
+
3
,
"ptd->wcstok_next is incorrect
\n
"
);
up
=
p__mbstok
(
mbstok_test
,
(
unsigned
char
*
)
"t"
);
ok
(
ptd
->
mbstok_next
==
up
+
3
,
"ptd->mbstok_next is incorrect
\n
"
);
ok
(
p_strerror
(
0
)
==
ptd
->
strerror_buffer
,
"ptd->strerror_buffer is incorrect
\n
"
);
ok
(
p_wcserror
(
0
)
==
ptd
->
wcserror_buffer
,
"ptd->wcserror_buffer is incorrect
\n
"
);
ok
(
p_tmpnam
(
NULL
)
==
ptd
->
tmpnam_buffer
,
"ptd->tmpnam_buffer is incorrect
\n
"
);
...
...
dlls/msvcrt/tests/string.c
View file @
eb13a49d
...
...
@@ -2193,6 +2193,24 @@ static void test__mbslwr_s(void)
buffer
);
}
static
void
test__mbstok
(
void
)
{
const
unsigned
char
delim
[]
=
"t"
;
char
str
[]
=
"!.!test"
;
unsigned
char
*
ret
;
strtok
(
str
,
"!"
);
ret
=
_mbstok
(
NULL
,
delim
);
/* most versions of msvcrt use the same buffer for strtok and _mbstok */
ok
(
!
ret
||
broken
((
char
*
)
ret
==
str
+
4
),
"_mbstok(NULL,
\"
t
\"
) = %p, expected NULL (%p)
\n
"
,
ret
,
str
);
ret
=
_mbstok
(
NULL
,
delim
);
ok
(
!
ret
,
"_mbstok(NULL,
\"
t
\"
) = %p, expected NULL
\n
"
,
ret
);
}
static
void
test__ultoa_s
(
void
)
{
errno_t
ret
;
...
...
@@ -2615,6 +2633,7 @@ START_TEST(string)
test_mbctombb
();
test_ismbclegal
();
test_strtok
();
test__mbstok
();
test_wcscpy_s
();
test__wcsupr_s
();
test_strtol
();
...
...
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