Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
bc566b58
Commit
bc566b58
authored
May 23, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CI breakages.
parent
df52bf86
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
stringify.c++
c++/src/capnp/stringify.c++
+0
-2
encoding-test.c++
c++/src/kj/encoding-test.c++
+9
-3
No files found.
c++/src/capnp/stringify.c++
View file @
bc566b58
...
...
@@ -28,8 +28,6 @@ namespace capnp {
namespace
{
static
const
char
HEXDIGITS
[]
=
"0123456789abcdef"
;
enum
PrintMode
{
BARE
,
// The value is planned to be printed on its own line, unless it is very short and contains
...
...
c++/src/kj/encoding-test.c++
View file @
bc566b58
...
...
@@ -35,7 +35,7 @@ CappedArray<char, sizeof(char32_t) * 2 + 1> hex(char32_t i) { return kj::hex((ui
// TODO(cleanup): Should this go into string.h with the other definitions of hex()?
template
<
typename
T
>
void
expectRes
(
EncodingResult
<
T
>
result
,
void
expectRes
Impl
(
EncodingResult
<
T
>
result
,
ArrayPtr
<
const
Decay
<
decltype
(
result
[
0
])
>>
expected
,
bool
errors
=
false
)
{
if
(
errors
)
{
...
...
@@ -54,14 +54,14 @@ template <typename T, size_t s>
void
expectRes
(
EncodingResult
<
T
>
result
,
const
Decay
<
decltype
(
result
[
0
])
>
(
&
expected
)[
s
],
bool
errors
=
false
)
{
expectRes
(
kj
::
mv
(
result
),
arrayPtr
(
expected
,
s
-
1
),
errors
);
expectRes
Impl
(
kj
::
mv
(
result
),
arrayPtr
(
expected
,
s
-
1
),
errors
);
}
template
<
typename
T
,
size_t
s
>
void
expectRes
(
EncodingResult
<
T
>
result
,
byte
(
&
expected
)[
s
],
bool
errors
=
false
)
{
expectRes
(
kj
::
mv
(
result
),
arrayPtr
(
expected
,
s
),
errors
);
expectRes
Impl
(
kj
::
mv
(
result
),
arrayPtr
(
expected
,
s
),
errors
);
}
KJ_TEST
(
"encode UTF-8 to UTF-16"
)
{
...
...
@@ -94,7 +94,13 @@ KJ_TEST("invalid UTF-8 to UTF-16") {
expectRes
(
encodeUtf16
(
"
\xe0\x80\x80
"
),
u"\ufffd"
,
true
);
expectRes
(
encodeUtf16
(
"
\xe0\x9f\xbf
"
),
u"\ufffd"
,
true
);
expectRes
(
encodeUtf16
(
"
\xe0\xa0\x80
"
),
u"\u0800"
,
false
);
expectRes
(
encodeUtf16
(
"
\xef\xbf\xbe
"
),
u"\ufffe"
,
false
);
// Due to a classic off-by-one error, GCC 4.x rather hilariously encodes '\uffff' as the
// "surrogate pair" 0xd7ff, 0xdfff: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41698
if
(
kj
::
size
(
u"\uffff"
)
==
2
)
{
expectRes
(
encodeUtf16
(
"
\xef\xbf\xbf
"
),
u"\uffff"
,
false
);
}
expectRes
(
encodeUtf16
(
"
\xf0\x80\x80\x80
"
),
u"\ufffd"
,
true
);
expectRes
(
encodeUtf16
(
"
\xf0\x8f\xbf\xbf
"
),
u"\ufffd"
,
true
);
...
...
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