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
166b7f4f
Commit
166b7f4f
authored
Jul 20, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90/tests: Added char_traits<char>::_Copy_s tests.
parent
b5a6ed74
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
misc.c
dlls/msvcp90/tests/misc.c
+52
-0
No files found.
dlls/msvcp90/tests/misc.c
View file @
166b7f4f
...
...
@@ -32,6 +32,8 @@ static BYTE (__cdecl *p_char_eq)(const void*, const void*);
static
BYTE
(
__cdecl
*
p_wchar_eq
)(
const
void
*
,
const
void
*
);
static
BYTE
(
__cdecl
*
p_short_eq
)(
const
void
*
,
const
void
*
);
static
char
*
(
__cdecl
*
p_Copy_s
)(
char
*
,
unsigned
int
,
const
char
*
,
unsigned
int
);
static
int
invalid_parameter
=
0
;
static
void
__cdecl
test_invalid_parameter_handler
(
const
wchar_t
*
expression
,
const
wchar_t
*
function
,
const
wchar_t
*
file
,
...
...
@@ -70,6 +72,8 @@ static BOOL init(void)
p_wchar_eq
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?eq@?$char_traits@_W@std@@SA_NAB_W0@Z"
);
p_short_eq
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?eq@?$char_traits@G@std@@SA_NABG0@Z"
);
p_Copy_s
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?_Copy_s@?$char_traits@D@std@@SAPADPADIPBDI@Z"
);
return
TRUE
;
}
...
...
@@ -136,6 +140,53 @@ static void test_equal(void)
ok
(
ret
==
FALSE
,
"ret = %d
\n
"
,
(
int
)
ret
);
}
static
void
test_Copy_s
(
void
)
{
static
const
char
src
[]
=
"abcd"
;
char
dest
[
32
],
*
ret
;
if
(
!
p_Copy_s
)
{
win_skip
(
"Copy_s tests skipped
\n
"
);
return
;
}
dest
[
4
]
=
'#'
;
dest
[
5
]
=
'\0'
;
ret
=
p_Copy_s
(
dest
,
4
,
src
,
4
);
ok
(
ret
==
dest
,
"ret != dest
\n
"
);
ok
(
dest
[
4
]
==
'#'
,
"dest[4] != '#'
\n
"
);
ok
(
!
memcmp
(
dest
,
src
,
sizeof
(
char
[
4
])),
"dest = %s
\n
"
,
dest
);
ret
=
p_Copy_s
(
dest
,
32
,
src
,
4
);
ok
(
ret
==
dest
,
"ret != dest
\n
"
);
ok
(
dest
[
4
]
==
'#'
,
"dest[4] != '#'
\n
"
);
ok
(
!
memcmp
(
dest
,
src
,
sizeof
(
char
[
4
])),
"dest = %s
\n
"
,
dest
);
errno
=
0xdeadbeef
;
dest
[
0
]
=
'#'
;
ret
=
p_Copy_s
(
dest
,
3
,
src
,
4
);
ok
(
ret
==
dest
,
"ret != dest
\n
"
);
ok
(
dest
[
0
]
==
'\0'
,
"dest[0] != 0
\n
"
);
ok
(
invalid_parameter
==
1
,
"invalid_parameter = %d
\n
"
,
invalid_parameter
);
invalid_parameter
=
0
;
ok
(
errno
==
0xdeadbeef
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
p_Copy_s
(
NULL
,
32
,
src
,
4
);
ok
(
invalid_parameter
==
1
,
"invalid_parameter = %d
\n
"
,
invalid_parameter
);
invalid_parameter
=
0
;
ok
(
errno
==
0xdeadbeef
,
"errno = %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
p_Copy_s
(
dest
,
32
,
NULL
,
4
);
ok
(
invalid_parameter
==
1
,
"invalid_parameter = %d
\n
"
,
invalid_parameter
);
invalid_parameter
=
0
;
ok
(
errno
==
0xdeadbeef
,
"errno = %d
\n
"
,
errno
);
}
START_TEST
(
misc
)
{
if
(
!
init
())
...
...
@@ -143,6 +194,7 @@ START_TEST(misc)
test_assign
();
test_equal
();
test_Copy_s
();
ok
(
!
invalid_parameter
,
"invalid_parameter_handler was invoked too many times
\n
"
);
}
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