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
1990a5e0
Commit
1990a5e0
authored
Nov 27, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90/tests: Use wide-char string literals.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4deb599d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
26 deletions
+14
-26
ios.c
dlls/msvcp90/tests/ios.c
+4
-12
string.c
dlls/msvcp90/tests/string.c
+10
-14
No files found.
dlls/msvcp90/tests/ios.c
View file @
1990a5e0
...
...
@@ -2111,8 +2111,6 @@ static void test_istream_getline(void)
static
void
test_ostream_print_ushort
(
void
)
{
static
const
wchar_t
str65
[]
=
{
'6'
,
'5'
,
0
};
basic_stringstream_wchar
wss
;
basic_string_wchar
pwstr
;
const
wchar_t
*
wstr
;
...
...
@@ -2122,7 +2120,7 @@ static void test_ostream_print_ushort(void)
call_func2
(
p_basic_stringstream_wchar_str_get
,
&
wss
,
&
pwstr
);
wstr
=
call_func1
(
p_basic_string_wchar_cstr
,
&
pwstr
);
ok
(
!
lstrcmpW
(
str65
,
wstr
),
"wstr = %s
\n
"
,
wine_dbgstr_w
(
wstr
));
ok
(
!
lstrcmpW
(
L"65"
,
wstr
),
"wstr = %s
\n
"
,
wine_dbgstr_w
(
wstr
));
call_func1
(
p_basic_string_wchar_dtor
,
&
pwstr
);
call_func1
(
p_basic_stringstream_wchar_vbase_dtor
,
&
wss
);
...
...
@@ -2130,8 +2128,6 @@ static void test_ostream_print_ushort(void)
static
void
test_ostream_print_float
(
void
)
{
static
const
char
float_str
[]
=
"3.14159"
;
basic_stringstream_char
ss
;
basic_string_char
pstr
;
const
char
*
str
;
...
...
@@ -2142,7 +2138,7 @@ static void test_ostream_print_float(void)
call_func2_ptr_flt
(
p_basic_ostream_char_print_float
,
&
ss
.
base
.
base2
,
val
);
call_func2
(
p_basic_stringstream_char_str_get
,
&
ss
,
&
pstr
);
str
=
call_func1
(
p_basic_string_char_cstr
,
&
pstr
);
ok
(
!
strcmp
(
float_str
,
str
),
"str = %s
\n
"
,
str
);
ok
(
!
strcmp
(
"3.14159"
,
str
),
"str = %s
\n
"
,
str
);
call_func1
(
p_basic_string_char_dtor
,
&
pstr
);
call_func1
(
p_basic_stringstream_char_vbase_dtor
,
&
ss
);
...
...
@@ -2150,8 +2146,6 @@ static void test_ostream_print_float(void)
static
void
test_ostream_print_double
(
void
)
{
static
const
char
double_str
[]
=
"3.14159"
;
basic_stringstream_char
ss
;
basic_string_char
pstr
;
const
char
*
str
;
...
...
@@ -2162,7 +2156,7 @@ static void test_ostream_print_double(void)
call_func2_ptr_dbl
(
p_basic_ostream_char_print_double
,
&
ss
.
base
.
base2
,
val
);
call_func2
(
p_basic_stringstream_char_str_get
,
&
ss
,
&
pstr
);
str
=
call_func1
(
p_basic_string_char_cstr
,
&
pstr
);
ok
(
!
strcmp
(
double_str
,
str
),
"str = %s
\n
"
,
str
);
ok
(
!
strcmp
(
"3.14159"
,
str
),
"str = %s
\n
"
,
str
);
call_func1
(
p_basic_string_char_dtor
,
&
pstr
);
call_func1
(
p_basic_stringstream_char_vbase_dtor
,
&
ss
);
...
...
@@ -2170,8 +2164,6 @@ static void test_ostream_print_double(void)
static
void
test_ostream_wchar_print_double
(
void
)
{
static
const
wchar_t
double_str
[]
=
{
'3'
,
'.'
,
'1'
,
'4'
,
'1'
,
'5'
,
'9'
,
0
};
basic_stringstream_wchar
wss
;
basic_string_wchar
pwstr
;
const
wchar_t
*
wstr
;
...
...
@@ -2184,7 +2176,7 @@ static void test_ostream_wchar_print_double(void)
call_func2
(
p_basic_stringstream_wchar_str_get
,
&
wss
,
&
pwstr
);
wstr
=
call_func1
(
p_basic_string_wchar_cstr
,
&
pwstr
);
ok
(
!
lstrcmpW
(
double_str
,
wstr
),
"wstr = %s
\n
"
,
wine_dbgstr_w
(
wstr
));
ok
(
!
lstrcmpW
(
L"3.14159"
,
wstr
),
"wstr = %s
\n
"
,
wine_dbgstr_w
(
wstr
));
call_func1
(
p_basic_string_wchar_dtor
,
&
pwstr
);
call_func1
(
p_basic_stringstream_wchar_vbase_dtor
,
&
wss
);
}
...
...
dlls/msvcp90/tests/string.c
View file @
1990a5e0
...
...
@@ -517,12 +517,11 @@ static void test_basic_string_char_concatenate(void) {
}
static
void
test_basic_string_char_find
(
void
)
{
static
const
char
tmp
[]
=
{
'a'
,
'a'
,
'a'
,
'\0'
,
'b'
,
'b'
,
'b'
,
0
};
basic_string_char
str
;
size_t
ret
;
call_func1
(
p_basic_string_char_ctor
,
&
str
);
call_func3
(
p_basic_string_char_assign_cstr_len
,
&
str
,
tmp
,
7
);
call_func3
(
p_basic_string_char_assign_cstr_len
,
&
str
,
"aaa
\0
bbb"
,
7
);
ret
=
(
size_t
)
call_func4
(
p_basic_string_char_find_cstr_substr
,
&
str
,
"aaa"
,
0
,
3
);
ok
(
ret
==
0
,
"ret = %lu
\n
"
,
(
unsigned
long
)
ret
);
ret
=
(
size_t
)
call_func4
(
p_basic_string_char_find_cstr_substr
,
&
str
,
"aaa"
,
1
,
3
);
...
...
@@ -615,8 +614,6 @@ static void test_basic_string_char_replace(void) {
}
static
void
test_basic_string_wchar
(
void
)
{
static
const
wchar_t
test
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
basic_string_wchar
str1
,
str2
,
*
pstr
;
const
wchar_t
*
str
;
size_t
size
,
capacity
;
...
...
@@ -631,12 +628,12 @@ static void test_basic_string_wchar(void) {
ok
(
*
str
==
'\0'
,
"*str = %c
\n
"
,
*
str
);
call_func1
(
p_basic_string_wchar_dtor
,
&
str1
);
pstr
=
call_func2
(
p_basic_string_wchar_ctor_cstr
,
&
str1
,
test
);
pstr
=
call_func2
(
p_basic_string_wchar_ctor_cstr
,
&
str1
,
L"test"
);
ok
(
pstr
==
&
str1
,
"pstr != &str1
\n
"
);
str
=
call_func1
(
p_basic_string_wchar_cstr
,
&
str1
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
str
=
call_func1
(
p_basic_string_wchar_data
,
&
str1
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
size
=
(
size_t
)
call_func1
(
p_basic_string_wchar_size
,
&
str1
);
ok
(
size
==
4
,
"size = %lu
\n
"
,
(
unsigned
long
)
size
);
capacity
=
(
size_t
)
call_func1
(
p_basic_string_wchar_capacity
,
&
str1
);
...
...
@@ -646,9 +643,9 @@ static void test_basic_string_wchar(void) {
pstr
=
call_func2
(
p_basic_string_wchar_copy_ctor
,
&
str2
,
&
str1
);
ok
(
pstr
==
&
str2
,
"pstr != &str2
\n
"
);
str
=
call_func1
(
p_basic_string_wchar_cstr
,
&
str2
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
str
=
call_func1
(
p_basic_string_wchar_data
,
&
str2
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
call_func3
(
p_basic_string_wchar_erase
,
&
str2
,
1
,
2
);
str
=
call_func1
(
p_basic_string_wchar_cstr
,
&
str2
);
...
...
@@ -670,11 +667,11 @@ static void test_basic_string_wchar(void) {
capacity
=
(
size_t
)
call_func1
(
p_basic_string_wchar_capacity
,
&
str1
);
ok
(
capacity
>=
size
,
"capacity = %lu < size = %lu
\n
"
,
(
unsigned
long
)
capacity
,
(
unsigned
long
)
size
);
call_func3
(
p_basic_string_wchar_assign_cstr_len
,
&
str2
,
test
,
4
);
call_func3
(
p_basic_string_wchar_assign_cstr_len
,
&
str2
,
L"test"
,
4
);
str
=
call_func1
(
p_basic_string_wchar_cstr
,
&
str2
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
str
=
call_func1
(
p_basic_string_wchar_data
,
&
str2
);
ok
(
!
memcmp
(
str
,
test
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
ok
(
!
memcmp
(
str
,
L"test"
,
5
*
sizeof
(
wchar_t
)),
"str = %s
\n
"
,
wine_dbgstr_w
(
str
));
call_func3
(
p_basic_string_wchar_assign_cstr_len
,
&
str2
,
(
str
+
1
),
2
);
str
=
call_func1
(
p_basic_string_wchar_cstr
,
&
str2
);
...
...
@@ -769,7 +766,6 @@ static void test_basic_string_char_find_last_not_of(void) {
static
void
test_basic_string_dtor
(
void
)
{
#ifdef __i386__
static
const
wchar_t
qwerty
[]
=
{
'q'
,
'w'
,
'e'
,
'r'
,
't'
,
'y'
,
0
};
basic_string_wchar
str1
;
basic_string_char
str2
;
void
*
ret
;
...
...
@@ -777,7 +773,7 @@ static void test_basic_string_dtor(void) {
/* FEAR 1 installer expects that string destructors set EAX to
* zero on return (see bug 37358). */
call_func2
(
p_basic_string_wchar_ctor_cstr
,
&
str1
,
qwerty
);
call_func2
(
p_basic_string_wchar_ctor_cstr
,
&
str1
,
L"qwerty"
);
ret
=
call_func1
(
p_basic_string_wchar_dtor
,
&
str1
);
ok
(
ret
==
NULL
,
"expected NULL, got %p
\n
"
,
ret
);
...
...
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