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
79d7cd76
Commit
79d7cd76
authored
Apr 04, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add a test for undefined byte character conversion.
parent
5c571850
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
codepage.c
dlls/kernel32/tests/codepage.c
+53
-0
No files found.
dlls/kernel32/tests/codepage.c
View file @
79d7cd76
...
...
@@ -354,6 +354,57 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar)
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError() is %u
\n
"
,
GetLastError
());
}
static
void
test_undefined_byte_char
(
void
)
{
struct
tag_testset
{
INT
codepage
;
LPCSTR
str
;
BOOL
is_error
;
}
testset
[]
=
{
{
874
,
"
\xdd
"
,
TRUE
},
{
932
,
"
\xfe
"
,
TRUE
},
{
932
,
"
\x80
"
,
FALSE
},
{
936
,
"
\xff
"
,
TRUE
},
{
949
,
"
\xff
"
,
TRUE
},
{
950
,
"
\xff
"
,
TRUE
},
{
1252
,
"
\x90
"
,
FALSE
},
{
1253
,
"
\xaa
"
,
TRUE
},
{
1255
,
"
\xff
"
,
TRUE
},
{
1257
,
"
\xa5
"
,
TRUE
},
};
INT
i
,
ret
;
for
(
i
=
0
;
i
<
(
sizeof
(
testset
)
/
sizeof
(
testset
[
0
]));
i
++
)
{
if
(
!
IsValidCodePage
(
testset
[
i
].
codepage
))
{
skip
(
"Codepage %d not available
\n
"
,
testset
[
i
].
codepage
);
continue
;
}
SetLastError
(
0xdeadbeef
);
ret
=
MultiByteToWideChar
(
testset
[
i
].
codepage
,
MB_ERR_INVALID_CHARS
,
testset
[
i
].
str
,
-
1
,
NULL
,
0
);
if
(
testset
[
i
].
is_error
)
{
todo_wine
ok
(
ret
==
0
&&
GetLastError
()
==
ERROR_NO_UNICODE_TRANSLATION
,
"ret is %d, GetLastError is %u (cp %d)
\n
"
,
ret
,
GetLastError
(),
testset
[
i
].
codepage
);
}
else
{
ok
(
ret
==
strlen
(
testset
[
i
].
str
)
+
1
&&
GetLastError
()
==
0xdeadbeef
,
"ret is %d, GetLastError is %u (cp %d)
\n
"
,
ret
,
GetLastError
(),
testset
[
i
].
codepage
);
}
SetLastError
(
0xdeadbeef
);
ret
=
MultiByteToWideChar
(
testset
[
i
].
codepage
,
0
,
testset
[
i
].
str
,
-
1
,
NULL
,
0
);
ok
(
ret
==
strlen
(
testset
[
i
].
str
)
+
1
&&
GetLastError
()
==
0xdeadbeef
,
"ret is %d, GetLastError is %u (cp %d)
\n
"
,
ret
,
GetLastError
(),
testset
[
i
].
codepage
);
}
}
START_TEST
(
codepage
)
{
BOOL
bUsedDefaultChar
;
...
...
@@ -367,4 +418,6 @@ START_TEST(codepage)
/* WideCharToMultiByte has two code paths, test both here */
test_string_conversion
(
NULL
);
test_string_conversion
(
&
bUsedDefaultChar
);
test_undefined_byte_char
();
}
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