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
6d78cae3
Commit
6d78cae3
authored
Apr 19, 2016
by
Branislav Katreniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json: fix compiler warnings
parent
c94771f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
json-test.c++
c++/src/capnp/compat/json-test.c++
+3
-3
json.c++
c++/src/capnp/compat/json.c++
+6
-0
No files found.
c++/src/capnp/compat/json-test.c++
View file @
6d78cae3
...
...
@@ -214,7 +214,7 @@ KJ_TEST("decode all types") {
CASE
(
R"({"int32Field":"2147483647"})"
,
root
.
getInt32Field
()
==
2147483647
);
CASE
(
R"({"int64Field":-9007199254740992})"
,
root
.
getInt64Field
()
==
-
9007199254740992LL
);
CASE
(
R"({"int64Field":9007199254740991})"
,
root
.
getInt64Field
()
==
9007199254740991LL
);
CASE
(
R"({"int64Field":"-9223372036854775808"})"
,
root
.
getInt64Field
()
==
-
9223372036854775808LL
);
CASE
(
R"({"int64Field":"-9223372036854775808"})"
,
root
.
getInt64Field
()
==
-
9223372036854775808
U
LL
);
CASE
(
R"({"int64Field":"9223372036854775807"})"
,
root
.
getInt64Field
()
==
9223372036854775807LL
);
CASE_THROW
(
R"({"int64Field":"-9223372036854775809"})"
,
"Value out-of-range"
);
CASE_THROW
(
R"({"int64Field":"9223372036854775808"})"
,
"Value out-of-range"
);
...
...
@@ -230,8 +230,8 @@ KJ_TEST("decode all types") {
CASE
(
R"({"uInt32Field":"0"})"
,
root
.
getUInt32Field
()
==
0
);
CASE_THROW
(
R"({"uInt32Field":"42949672956"})"
,
"Value out-of-range"
);
CASE_THROW
(
R"({"uInt32Field":-1})"
,
"Value out-of-range"
);
CASE
(
R"({"uInt64Field":9007199254740991})"
,
root
.
getUInt64Field
()
==
9007199254740991
);
CASE
(
R"({"uInt64Field":"18446744073709551615"})"
,
root
.
getUInt64Field
()
==
18446744073709551615
);
CASE
(
R"({"uInt64Field":9007199254740991})"
,
root
.
getUInt64Field
()
==
9007199254740991
ULL
);
CASE
(
R"({"uInt64Field":"18446744073709551615"})"
,
root
.
getUInt64Field
()
==
18446744073709551615
ULL
);
CASE
(
R"({"uInt64Field":"0"})"
,
root
.
getUInt64Field
()
==
0
);
CASE_THROW
(
R"({"uInt64Field":"18446744073709551616"})"
,
"Value out-of-range"
);
CASE
(
R"({"float32Field":0})"
,
root
.
getFloat32Field
()
==
0
);
...
...
c++/src/capnp/compat/json.c++
View file @
6d78cae3
...
...
@@ -529,6 +529,12 @@ void decodeField(Type type, JsonValue::Reader value, SetFn setFn, DecodeArrayFn
KJ_FAIL_REQUIRE
(
"Expected object value"
);
}
break
;
case
schema
:
:
Type
::
INTERFACE
:
KJ_FAIL_REQUIRE
(
"don't know how to JSON-encode capabilities; "
"JsonCodec::Handler not implemented yet :("
);
case
schema
:
:
Type
::
ANY_POINTER
:
KJ_FAIL_REQUIRE
(
"don't know how to JSON-encode AnyPointer; "
"JsonCodec::Handler not implemented yet :("
);
}
}
}
// namespace
...
...
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