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
3773035a
Commit
3773035a
authored
Dec 12, 2002
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The Win9x platforms support WideCharToMultiByte and
MultiByteToWideChar but not lstrcmpW! So I implemented our own so that we can have a meaningful test.
parent
872f9450
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
codepage.c
dlls/kernel/tests/codepage.c
+15
-3
No files found.
dlls/kernel/tests/codepage.c
View file @
3773035a
...
...
@@ -22,6 +22,16 @@
#include "winbase.h"
#include "winnls.h"
/* lstrcmpW is not supported on Win9x! */
static
int
mylstrcmpW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
)
{
while
(
*
str1
&&
*
str1
==*
str2
)
{
str1
++
;
str2
++
;
}
return
*
str1
-*
str2
;
}
static
void
test_negative_source_length
(
void
)
{
int
len
;
...
...
@@ -31,14 +41,16 @@ static void test_negative_source_length(void)
/* Test, whether any negative source length works as strlen() + 1 */
SetLastError
(
0xdeadbeef
);
memset
(
buf
,
'x'
,
sizeof
(
buf
));
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
foobarW
,
-
2002
,
buf
,
10
,
NULL
,
NULL
);
ok
(
len
==
7
&&
!
lstrcmpA
(
buf
,
"foobar"
)
&&
GetLastError
()
==
0xdeadbeef
,
"
any negative value should work as strlen() + 1"
);
"
WideCharToMultiByte(-2002): len=%d error=%ld"
,
len
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
memset
(
bufW
,
'x'
,
sizeof
(
bufW
));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
"foobar"
,
-
2002
,
bufW
,
10
);
ok
(
len
==
7
&&
!
lstrcmpW
(
bufW
,
foobarW
)
&&
GetLastError
()
==
0xdeadbeef
,
"
any negative value should work as strlen() + 1"
);
ok
(
len
==
7
&&
!
my
lstrcmpW
(
bufW
,
foobarW
)
&&
GetLastError
()
==
0xdeadbeef
,
"
MultiByteToWideChar(-2002): len=%d error=%ld"
,
len
,
GetLastError
()
);
}
START_TEST
(
codepage
)
...
...
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