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
af780d88
Commit
af780d88
authored
Nov 16, 2010
by
Vincas Miliūnas
Committed by
Alexandre Julliard
Nov 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90/tests: Added basic_string<char>::swap tests.
parent
676d0d41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
string.c
dlls/msvcp90/tests/string.c
+41
-0
No files found.
dlls/msvcp90/tests/string.c
View file @
af780d88
...
...
@@ -60,6 +60,7 @@ static basic_string_char* (WINAPI *p_basic_string_char_assign_cstr_len)(const ch
static
const
char
*
(
WINAPI
*
p_basic_string_char_cstr
)(
void
);
static
const
char
*
(
WINAPI
*
p_basic_string_char_data
)(
void
);
static
size_t
(
WINAPI
*
p_basic_string_char_size
)(
void
);
static
void
(
WINAPI
*
p_basic_string_char_swap
)(
basic_string_char
*
);
static
basic_string_wchar
*
(
WINAPI
*
p_basic_string_wchar_ctor
)(
void
);
static
basic_string_wchar
*
(
WINAPI
*
p_basic_string_wchar_copy_ctor
)(
basic_string_wchar
*
);
...
...
@@ -80,6 +81,7 @@ static basic_string_char* (__cdecl *p_basic_string_char_assign_cstr_len)(basic_s
static
const
char
*
(
__cdecl
*
p_basic_string_char_cstr
)(
basic_string_char
*
);
static
const
char
*
(
__cdecl
*
p_basic_string_char_data
)(
basic_string_char
*
);
static
size_t
(
__cdecl
*
p_basic_string_char_size
)(
basic_string_char
*
);
static
void
(
__cdecl
*
p_basic_string_char_swap
)(
basic_string_char
*
,
basic_string_char
*
);
static
basic_string_wchar
*
(
__cdecl
*
p_basic_string_wchar_ctor
)(
basic_string_wchar
*
);
static
basic_string_wchar
*
(
__cdecl
*
p_basic_string_wchar_copy_ctor
)(
basic_string_wchar
*
,
basic_string_wchar
*
);
...
...
@@ -240,6 +242,8 @@ static BOOL init(void)
"?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ"
);
p_basic_string_char_size
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ"
);
p_basic_string_char_swap
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z"
);
p_basic_string_wchar_ctor
=
(
void
*
)
GetProcAddress
(
msvcp
,
"??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ"
);
...
...
@@ -279,6 +283,8 @@ static BOOL init(void)
"?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ"
);
p_basic_string_char_size
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ"
);
p_basic_string_char_swap
=
(
void
*
)
GetProcAddress
(
msvcp
,
"?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z"
);
p_basic_string_wchar_ctor
=
(
void
*
)
GetProcAddress
(
msvcp
,
"??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ"
);
...
...
@@ -375,6 +381,40 @@ static void test_basic_string_char(void) {
call_func1
(
p_basic_string_char_dtor
,
&
str2
);
}
static
void
test_basic_string_char_swap
(
void
)
{
basic_string_char
str1
,
str2
;
char
atmp1
[
32
],
atmp2
[
32
];
if
(
!
p_basic_string_char_ctor_cstr
||
!
p_basic_string_char_dtor
||
!
p_basic_string_char_swap
||
!
p_basic_string_char_cstr
)
{
win_skip
(
"basic_string<char> unavailable
\n
"
);
return
;
}
/* Swap self, local */
strcpy
(
atmp1
,
"qwerty"
);
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str1
,
atmp1
);
call_func2
(
p_basic_string_char_swap
,
&
str1
,
&
str1
);
ok
(
strcmp
(
atmp1
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str1
))
==
0
,
"Invalid value of str1
\n
"
);
call_func2
(
p_basic_string_char_swap
,
&
str1
,
&
str1
);
ok
(
strcmp
(
atmp1
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str1
))
==
0
,
"Invalid value of str1
\n
"
);
call_func1
(
p_basic_string_char_dtor
,
&
str1
);
/* str1 allocated, str2 local */
strcpy
(
atmp1
,
"qwerty12345678901234567890"
);
strcpy
(
atmp2
,
"asd"
);
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str1
,
atmp1
);
call_func2
(
p_basic_string_char_ctor_cstr
,
&
str2
,
atmp2
);
call_func2
(
p_basic_string_char_swap
,
&
str1
,
&
str2
);
ok
(
strcmp
(
atmp2
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str1
))
==
0
,
"Invalid value of str1
\n
"
);
ok
(
strcmp
(
atmp1
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str2
))
==
0
,
"Invalid value of str2
\n
"
);
call_func2
(
p_basic_string_char_swap
,
&
str1
,
&
str2
);
ok
(
strcmp
(
atmp1
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str1
))
==
0
,
"Invalid value of str1
\n
"
);
ok
(
strcmp
(
atmp2
,
(
const
char
*
)
call_func1
(
p_basic_string_char_cstr
,
&
str2
))
==
0
,
"Invalid value of str2
\n
"
);
call_func1
(
p_basic_string_char_dtor
,
&
str1
);
call_func1
(
p_basic_string_char_dtor
,
&
str2
);
}
static
void
test_basic_string_wchar
(
void
)
{
static
const
wchar_t
test
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -456,6 +496,7 @@ START_TEST(string)
return
;
test_basic_string_char
();
test_basic_string_char_swap
();
test_basic_string_wchar
();
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