Fix narrowing of the optimized-container count in BJData and UBJSON tests
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -4637,7 +4637,7 @@ TEST_CASE("BJData optimized container type marker is validated for count 0")
|
|||||||
{'[', '{'
|
{'[', '{'
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
for (const std::uint8_t count :
|
for (const int count :
|
||||||
{
|
{
|
||||||
0, 1
|
0, 1
|
||||||
})
|
})
|
||||||
@@ -4645,7 +4645,7 @@ TEST_CASE("BJData optimized container type marker is validated for count 0")
|
|||||||
CAPTURE(marker)
|
CAPTURE(marker)
|
||||||
CAPTURE(open)
|
CAPTURE(open)
|
||||||
CAPTURE(count)
|
CAPTURE(count)
|
||||||
const std::vector<std::uint8_t> v = {static_cast<std::uint8_t>(open), '$', static_cast<std::uint8_t>(marker), '#', 'i', count};
|
const std::vector<std::uint8_t> v = {static_cast<std::uint8_t>(open), '$', static_cast<std::uint8_t>(marker), '#', 'i', static_cast<std::uint8_t>(count)};
|
||||||
json _;
|
json _;
|
||||||
CHECK_THROWS_AS(_ = json::from_bjdata(v), json::parse_error&);
|
CHECK_THROWS_AS(_ = json::from_bjdata(v), json::parse_error&);
|
||||||
CHECK(json::from_bjdata(v, true, false).is_discarded());
|
CHECK(json::from_bjdata(v, true, false).is_discarded());
|
||||||
|
|||||||
@@ -3362,7 +3362,7 @@ TEST_CASE("UBJSON optimized container type marker is validated for count 0")
|
|||||||
{'[', '{'
|
{'[', '{'
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
for (const std::uint8_t count :
|
for (const int count :
|
||||||
{
|
{
|
||||||
0, 1
|
0, 1
|
||||||
})
|
})
|
||||||
@@ -3370,7 +3370,7 @@ TEST_CASE("UBJSON optimized container type marker is validated for count 0")
|
|||||||
CAPTURE(marker)
|
CAPTURE(marker)
|
||||||
CAPTURE(open)
|
CAPTURE(open)
|
||||||
CAPTURE(count)
|
CAPTURE(count)
|
||||||
const std::vector<std::uint8_t> v = {static_cast<std::uint8_t>(open), '$', static_cast<std::uint8_t>(marker), '#', 'i', count};
|
const std::vector<std::uint8_t> v = {static_cast<std::uint8_t>(open), '$', static_cast<std::uint8_t>(marker), '#', 'i', static_cast<std::uint8_t>(count)};
|
||||||
json _;
|
json _;
|
||||||
CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&);
|
CHECK_THROWS_AS(_ = json::from_ubjson(v), json::parse_error&);
|
||||||
CHECK(json::from_ubjson(v, true, false).is_discarded());
|
CHECK(json::from_ubjson(v, true, false).is_discarded());
|
||||||
|
|||||||
Reference in new issue
Block a user