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
32acf313
Commit
32acf313
authored
Aug 10, 2018
by
Daniel Lehman
Committed by
Alexandre Julliard
Aug 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add some CompareStringA/W tests.
Signed-off-by:
Daniel Lehman
<
dlehman@esri.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
05e54ac6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
locale.c
dlls/kernel32/tests/locale.c
+26
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
32acf313
...
...
@@ -1839,6 +1839,8 @@ static const struct comparestringa_entry comparestringa_data[] = {
static
void
test_CompareStringA
(
void
)
{
static
const
char
ABC_EE
[]
=
{
'A'
,
'B'
,
'C'
,
0
,
0xEE
};
static
const
char
ABC_FF
[]
=
{
'A'
,
'B'
,
'C'
,
0
,
0xFF
};
int
ret
,
i
;
char
a
[
256
];
LCID
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_FRENCH
,
SUBLANG_DEFAULT
),
SORT_DEFAULT
);
...
...
@@ -1980,10 +1982,23 @@ static void test_CompareStringA(void)
ret
=
CompareStringA
(
lcid
,
0
,
a
,
sizeof
(
a
),
a
,
sizeof
(
a
));
ok
(
GetLastError
()
==
0xdeadbeef
&&
ret
==
CSTR_EQUAL
,
"ret %d, error %d, expected value %d
\n
"
,
ret
,
GetLastError
(),
CSTR_EQUAL
);
ret
=
CompareStringA
(
CP_ACP
,
0
,
ABC_EE
,
3
,
ABC_FF
,
3
);
ok
(
ret
==
CSTR_EQUAL
,
"expected CSTR_EQUAL, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
CP_ACP
,
0
,
ABC_EE
,
5
,
ABC_FF
,
3
);
ok
(
ret
==
CSTR_GREATER_THAN
,
"expected CSTR_GREATER_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
CP_ACP
,
0
,
ABC_EE
,
3
,
ABC_FF
,
5
);
ok
(
ret
==
CSTR_LESS_THAN
,
"expected CSTR_LESS_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
CP_ACP
,
0
,
ABC_EE
,
5
,
ABC_FF
,
5
);
ok
(
ret
==
CSTR_LESS_THAN
,
"expected CSTR_LESS_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringA
(
CP_ACP
,
0
,
ABC_FF
,
5
,
ABC_EE
,
5
);
ok
(
ret
==
CSTR_GREATER_THAN
,
"expected CSTR_GREATER_THAN, got %d
\n
"
,
ret
);
}
static
void
test_CompareStringW
(
void
)
{
static
const
WCHAR
ABC_EE
[]
=
{
'A'
,
'B'
,
'C'
,
0
,
0xEE
};
static
const
WCHAR
ABC_FF
[]
=
{
'A'
,
'B'
,
'C'
,
0
,
0xFF
};
WCHAR
*
str1
,
*
str2
;
SYSTEM_INFO
si
;
DWORD
old_prot
;
...
...
@@ -2010,6 +2025,17 @@ static void test_CompareStringW(void)
success
=
VirtualFree
(
buf
,
0
,
MEM_RELEASE
);
ok
(
success
,
"VirtualFree failed with %u
\n
"
,
GetLastError
());
ret
=
CompareStringW
(
CP_ACP
,
0
,
ABC_EE
,
3
,
ABC_FF
,
3
);
ok
(
ret
==
CSTR_EQUAL
,
"expected CSTR_EQUAL, got %d
\n
"
,
ret
);
ret
=
CompareStringW
(
CP_ACP
,
0
,
ABC_EE
,
5
,
ABC_FF
,
3
);
ok
(
ret
==
CSTR_GREATER_THAN
,
"expected CSTR_GREATER_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringW
(
CP_ACP
,
0
,
ABC_EE
,
3
,
ABC_FF
,
5
);
ok
(
ret
==
CSTR_LESS_THAN
,
"expected CSTR_LESS_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringW
(
CP_ACP
,
0
,
ABC_EE
,
5
,
ABC_FF
,
5
);
ok
(
ret
==
CSTR_LESS_THAN
,
"expected CSTR_LESS_THAN, got %d
\n
"
,
ret
);
ret
=
CompareStringW
(
CP_ACP
,
0
,
ABC_FF
,
5
,
ABC_EE
,
5
);
ok
(
ret
==
CSTR_GREATER_THAN
,
"expected CSTR_GREATER_THAN, got %d
\n
"
,
ret
);
}
struct
comparestringex_test
{
...
...
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