mirror of
https://github.com/nlohmann/json.git
synced 2026-02-24 12:26:25 +00:00
CI: Enable 32bit unit test (3) (#3532)
* Enable JSON_MultipleHeaders by default * CI: Add single-header build * CI: Enable 32bit unit test * Fix "-Wuseless-cast" warnings * Remove coverage exclusion * Fix 32bit test case
This commit is contained in:
committed by
GitHub
parent
9c31d54389
commit
e80945da2c
@@ -98,18 +98,14 @@ TEST_CASE("BJData")
|
||||
{
|
||||
SECTION("array")
|
||||
{
|
||||
SECTION("optimized array: no size following type")
|
||||
{
|
||||
std::vector<uint8_t> v = {'[', '$', 'i', 2};
|
||||
json _;
|
||||
CHECK_THROWS_WITH_AS(_ = json::from_bjdata(v), "[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing BJData size: expected '#' after type information; last byte: 0x02", json::parse_error&);
|
||||
}
|
||||
|
||||
SECTION("optimized array: negative size")
|
||||
SECTION("optimized array: integer value overflow")
|
||||
{
|
||||
std::vector<uint8_t> vL = {'[', '#', 'L', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F};
|
||||
std::vector<uint8_t> vM = {'[', '$', 'M', '#', '[', 'I', 0x00, 0x20, 'M', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xFF, ']'};
|
||||
|
||||
json _;
|
||||
CHECK_THROWS_WITH_AS(_ = json::from_bjdata(vL), "[json.exception.out_of_range.408] syntax error while parsing BJData size: integer value overflow", json::out_of_range&);
|
||||
|
||||
CHECK_THROWS_WITH_AS(_ = json::from_bjdata(vM), "[json.exception.out_of_range.408] syntax error while parsing BJData size: integer value overflow", json::out_of_range&);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user