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
0c4e0735
Commit
0c4e0735
authored
Jun 14, 2016
by
Alex Henrie
Committed by
Alexandre Julliard
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr90: Add tests for mbstowcs and wcstombs with a negative count.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4ab42d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+69
-0
No files found.
dlls/msvcr90/tests/msvcr90.c
View file @
0c4e0735
...
@@ -123,6 +123,9 @@ static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long);
...
@@ -123,6 +123,9 @@ static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long);
static
void
**
(
__cdecl
*
p__pxcptinfoptrs
)(
void
);
static
void
**
(
__cdecl
*
p__pxcptinfoptrs
)(
void
);
static
void
*
(
__cdecl
*
p__AdjustPointer
)(
void
*
,
const
void
*
);
static
void
*
(
__cdecl
*
p__AdjustPointer
)(
void
*
,
const
void
*
);
static
int
(
__cdecl
*
p_fflush_nolock
)(
FILE
*
);
static
int
(
__cdecl
*
p_fflush_nolock
)(
FILE
*
);
static
size_t
(
__cdecl
*
p_mbstowcs
)(
wchar_t
*
,
const
char
*
,
size_t
);
static
size_t
(
__cdecl
*
p_wcstombs
)(
char
*
,
const
wchar_t
*
,
size_t
);
static
char
*
(
__cdecl
*
p_setlocale
)(
int
,
const
char
*
);
/* make sure we use the correct errno */
/* make sure we use the correct errno */
#undef errno
#undef errno
...
@@ -383,6 +386,9 @@ static BOOL init(void)
...
@@ -383,6 +386,9 @@ static BOOL init(void)
SET
(
p__pxcptinfoptrs
,
"__pxcptinfoptrs"
);
SET
(
p__pxcptinfoptrs
,
"__pxcptinfoptrs"
);
SET
(
p__AdjustPointer
,
"__AdjustPointer"
);
SET
(
p__AdjustPointer
,
"__AdjustPointer"
);
SET
(
p_fflush_nolock
,
"_fflush_nolock"
);
SET
(
p_fflush_nolock
,
"_fflush_nolock"
);
SET
(
p_mbstowcs
,
"mbstowcs"
);
SET
(
p_wcstombs
,
"wcstombs"
);
SET
(
p_setlocale
,
"setlocale"
);
if
(
sizeof
(
void
*
)
==
8
)
if
(
sizeof
(
void
*
)
==
8
)
{
{
SET
(
p_type_info_name_internal_method
,
"?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"
);
SET
(
p_type_info_name_internal_method
,
"?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"
);
...
@@ -1479,6 +1485,68 @@ static void test__AdjustPointer(void)
...
@@ -1479,6 +1485,68 @@ static void test__AdjustPointer(void)
}
}
}
}
static
void
test_mbstowcs
(
void
)
{
wchar_t
bufw
[
16
];
char
buf
[
16
];
size_t
ret
;
buf
[
0
]
=
'a'
;
buf
[
1
]
=
0
;
memset
(
bufw
,
'x'
,
sizeof
(
bufw
));
ret
=
p_mbstowcs
(
bufw
,
buf
,
-
1
);
ok
(
ret
==
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
bufw
[
0
]
==
'a'
,
"bufw[0] = '%c'
\n
"
,
bufw
[
0
]);
ok
(
bufw
[
1
]
==
0
,
"bufw[1] = '%c'
\n
"
,
bufw
[
1
]);
memset
(
bufw
,
'x'
,
sizeof
(
bufw
));
ret
=
p_mbstowcs
(
bufw
,
buf
,
-
1000
);
ok
(
ret
==
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
bufw
[
0
]
==
'a'
,
"bufw[0] = '%c'
\n
"
,
bufw
[
0
]);
ok
(
bufw
[
1
]
==
0
,
"bufw[1] = '%c'
\n
"
,
bufw
[
1
]);
memset
(
buf
,
'x'
,
sizeof
(
buf
));
ret
=
p_wcstombs
(
buf
,
bufw
,
-
1
);
ok
(
ret
==
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
buf
[
0
]
==
'a'
,
"buf[0] = '%c'
\n
"
,
buf
[
0
]);
ok
(
buf
[
1
]
==
0
,
"buf[1] = '%c'
\n
"
,
buf
[
1
]);
memset
(
buf
,
'x'
,
sizeof
(
buf
));
ret
=
p_wcstombs
(
buf
,
bufw
,
-
1000
);
ok
(
ret
==
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
buf
[
0
]
==
'a'
,
"buf[0] = '%c'
\n
"
,
buf
[
0
]);
ok
(
buf
[
1
]
==
0
,
"buf[1] = '%c'
\n
"
,
buf
[
1
]);
if
(
!
p_setlocale
(
LC_ALL
,
"English"
))
{
win_skip
(
"English locale not available
\n
"
);
return
;
}
buf
[
0
]
=
'a'
;
buf
[
1
]
=
0
;
memset
(
bufw
,
'x'
,
sizeof
(
bufw
));
ret
=
p_mbstowcs
(
bufw
,
buf
,
-
1
);
ok
(
ret
==
-
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
bufw
[
0
]
==
0
,
"bufw[0] = '%c'
\n
"
,
bufw
[
0
]);
memset
(
bufw
,
'x'
,
sizeof
(
bufw
));
ret
=
p_mbstowcs
(
bufw
,
buf
,
-
1000
);
ok
(
ret
==
-
1
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
bufw
[
0
]
==
0
,
"bufw[0] = '%c'
\n
"
,
bufw
[
0
]);
memset
(
buf
,
'x'
,
sizeof
(
buf
));
ret
=
p_wcstombs
(
buf
,
bufw
,
-
1
);
ok
(
ret
==
0
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
buf
[
0
]
==
0
,
"buf[0] = '%c'
\n
"
,
buf
[
0
]);
memset
(
buf
,
'x'
,
sizeof
(
buf
));
ret
=
p_wcstombs
(
buf
,
bufw
,
-
1000
);
ok
(
ret
==
0
,
"ret = %d
\n
"
,
(
int
)
ret
);
ok
(
buf
[
0
]
==
0
,
"buf[0] = '%c'
\n
"
,
buf
[
0
]);
p_setlocale
(
LC_ALL
,
"C"
);
}
START_TEST
(
msvcr90
)
START_TEST
(
msvcr90
)
{
{
if
(
!
init
())
if
(
!
init
())
...
@@ -1507,4 +1575,5 @@ START_TEST(msvcr90)
...
@@ -1507,4 +1575,5 @@ START_TEST(msvcr90)
test_access_s
();
test_access_s
();
test_is_exception_typeof
();
test_is_exception_typeof
();
test__AdjustPointer
();
test__AdjustPointer
();
test_mbstowcs
();
}
}
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