Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
2f007ca0
Unverified
Commit
2f007ca0
authored
Jun 20, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✅
improved coverage
parent
a5c27ede
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
src/json.hpp
src/json.hpp
+2
-2
test/src/unit-cbor.cpp
test/src/unit-cbor.cpp
+7
-0
test/src/unit-msgpack.cpp
test/src/unit-msgpack.cpp
+7
-0
No files found.
src/json.hpp
View file @
2f007ca0
...
...
@@ -9986,7 +9986,7 @@ class basic_json
}
else
{
vec
[
i
]
=
static_cast
<
uint8_t
>
(
current
);
vec
[
i
]
=
static_cast
<
uint8_t
>
(
current
);
// LCOV_EXCL_LINE
}
}
...
...
@@ -10744,7 +10744,7 @@ class basic_json
}
else
{
oa
->
write_character
(
vec
[
i
]);
oa
->
write_character
(
vec
[
i
]);
// LCOV_EXCL_LINE
}
}
}
...
...
test/src/unit-cbor.cpp
View file @
2f007ca0
...
...
@@ -1253,6 +1253,13 @@ TEST_CASE("CBOR")
}
}
}
SECTION
(
"invalid string in map"
)
{
CHECK_THROWS_AS
(
json
::
from_cbor
(
std
::
vector
<
uint8_t
>
({
0xa1
,
0xff
,
0x01
})),
json
::
parse_error
);
CHECK_THROWS_WITH
(
json
::
from_cbor
(
std
::
vector
<
uint8_t
>
({
0xa1
,
0xff
,
0x01
})),
"[json.exception.parse_error.113] parse error at 2: expected a CBOR string; last byte: 0xff"
);
}
}
}
...
...
test/src/unit-msgpack.cpp
View file @
2f007ca0
...
...
@@ -1094,6 +1094,13 @@ TEST_CASE("MessagePack")
}
}
}
SECTION
(
"invalid string in map"
)
{
CHECK_THROWS_AS
(
json
::
from_msgpack
(
std
::
vector
<
uint8_t
>
({
0x81
,
0xff
,
0x01
})),
json
::
parse_error
);
CHECK_THROWS_WITH
(
json
::
from_msgpack
(
std
::
vector
<
uint8_t
>
({
0x81
,
0xff
,
0x01
})),
"[json.exception.parse_error.113] parse error at 2: expected a MessagePack string; last byte: 0xff"
);
}
}
}
...
...
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