✅ improved coverage
This commit is contained in:
parent
a5c27ede32
commit
2f007ca092
3 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue