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
0f936686
Commit
0f936686
authored
Nov 06, 2014
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add UTF-7 implicit termination tests.
parent
14f41641
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 @
0f936686
...
...
@@ -592,6 +592,59 @@ static void test_utf7_decoding(void)
"i=0x%02x: expected output=%s, got output=%s
\n
"
,
i
,
wine_dbgstr_wn
(
expected
,
expected_len
+
1
),
wine_dbgstr_wn
(
output
,
expected_len
+
1
));
}
/* test which one-byte characters terminate a sequence
* also test whether the unfinished byte pair is discarded or not */
for
(
i
=
0
;
i
<
256
;
i
++
)
{
sprintf
(
input
,
"+B%c+AAA"
,
i
);
memset
(
output
,
0x23
,
sizeof
(
output
)
-
sizeof
(
WCHAR
));
output
[
sizeof
(
output
)
/
sizeof
(
WCHAR
)
-
1
]
=
0
;
len
=
MultiByteToWideChar
(
CP_UTF7
,
0
,
input
,
8
,
output
,
sizeof
(
output
)
/
sizeof
(
WCHAR
)
-
1
);
if
(
i
==
'-'
)
{
/* explicitly terminates */
expected_len
=
2
;
expected
[
0
]
=
0
;
expected
[
1
]
=
0
;
}
else
if
(
i
<=
0x7F
)
{
if
(
base64_decoding_table
[
i
]
!=
-
1
)
{
/* absorbs the character into the base64 sequence */
expected_len
=
3
;
expected
[
0
]
=
0x0400
|
(
base64_decoding_table
[
i
]
<<
4
)
|
0x000F
;
expected
[
1
]
=
0x8000
;
expected
[
2
]
=
0
;
}
else
{
/* implicitly terminates and discards the unfinished byte pair */
expected_len
=
3
;
expected
[
0
]
=
i
;
expected
[
1
]
=
0
;
expected
[
2
]
=
0
;
}
}
else
{
/* implicitly terminates but does not the discard unfinished byte pair */
expected_len
=
3
;
expected
[
0
]
=
i
;
expected
[
1
]
=
0x0400
;
expected
[
2
]
=
0
;
}
expected
[
expected_len
]
=
0x2323
;
ok
(
len
==
expected_len
,
"i=0x%02x: expected len=%i, got len=%i
\n
"
,
i
,
expected_len
,
len
);
ok
(
memcmp
(
output
,
expected
,
(
expected_len
+
1
)
*
sizeof
(
WCHAR
))
==
0
,
"i=0x%02x: expected output=%s, got output=%s
\n
"
,
i
,
wine_dbgstr_wn
(
expected
,
expected_len
+
1
),
wine_dbgstr_wn
(
output
,
expected_len
+
1
));
}
}
static
void
test_undefined_byte_char
(
void
)
...
...
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