🚨 fix warnings
This commit is contained in:
parent
cd3d64ca37
commit
b17f28f714
@ -45,7 +45,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
|||||||
// step 2.1: round trip without adding size annotations to container types
|
// step 2.1: round trip without adding size annotations to container types
|
||||||
std::vector<uint8_t> const vec2 = json::to_bjdata(j1, false, false);
|
std::vector<uint8_t> const vec2 = json::to_bjdata(j1, false, false);
|
||||||
|
|
||||||
// step 2.2: round trip with adding size annotations but without adding type annonations to container types
|
// step 2.2: round trip with adding size annotations but without adding type annotations to container types
|
||||||
std::vector<uint8_t> const vec3 = json::to_bjdata(j1, true, false);
|
std::vector<uint8_t> const vec3 = json::to_bjdata(j1, true, false);
|
||||||
|
|
||||||
// step 2.3: round trip with adding size as well as type annotations to container types
|
// step 2.3: round trip with adding size as well as type annotations to container types
|
||||||
|
|||||||
@ -45,7 +45,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
|||||||
// step 2.1: round trip without adding size annotations to container types
|
// step 2.1: round trip without adding size annotations to container types
|
||||||
std::vector<uint8_t> const vec2 = json::to_ubjson(j1, false, false);
|
std::vector<uint8_t> const vec2 = json::to_ubjson(j1, false, false);
|
||||||
|
|
||||||
// step 2.2: round trip with adding size annotations but without adding type annonations to container types
|
// step 2.2: round trip with adding size annotations but without adding type annotations to container types
|
||||||
std::vector<uint8_t> const vec3 = json::to_ubjson(j1, true, false);
|
std::vector<uint8_t> const vec3 = json::to_ubjson(j1, true, false);
|
||||||
|
|
||||||
// step 2.3: round trip with adding size as well as type annotations to container types
|
// step 2.3: round trip with adding size as well as type annotations to container types
|
||||||
|
|||||||
@ -562,7 +562,7 @@ TEST_CASE("BSON")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Examples from http://bsonspec.org/faq.html")
|
SECTION("Examples from https://bsonspec.org/faq.html")
|
||||||
{
|
{
|
||||||
SECTION("Example 1")
|
SECTION("Example 1")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1962,7 +1962,7 @@ TEST_CASE("CBOR regressions")
|
|||||||
CHECK(false);
|
CHECK(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const json::parse_error&)
|
catch (const json::parse_error&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
// parse errors are ok, because input may be random bytes
|
// parse errors are ok, because input may be random bytes
|
||||||
}
|
}
|
||||||
|
|||||||
@ -542,13 +542,13 @@ TEST_CASE("parser class")
|
|||||||
CHECK(parser_helper("9007199254740991").get<int64_t>() == 9007199254740991);
|
CHECK(parser_helper("9007199254740991").get<int64_t>() == 9007199254740991);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("over the edge cases") // issue #178 - Integer conversion to unsigned (incorrect handling of 64 bit integers)
|
SECTION("over the edge cases") // issue #178 - Integer conversion to unsigned (incorrect handling of 64-bit integers)
|
||||||
{
|
{
|
||||||
// While RFC8259, Section 6 specifies a preference for support
|
// While RFC8259, Section 6 specifies a preference for support
|
||||||
// for ranges in range of IEEE 754-2008 binary64 (double precision)
|
// for ranges in range of IEEE 754-2008 binary64 (double precision)
|
||||||
// this does not accommodate 64 bit integers without loss of accuracy.
|
// this does not accommodate 64-bit integers without loss of accuracy.
|
||||||
// As 64 bit integers are now widely used in software, it is desirable
|
// As 64-bit integers are now widely used in software, it is desirable
|
||||||
// to expand support to to the full 64 bit (signed and unsigned) range
|
// to expand support to the full 64 bit (signed and unsigned) range
|
||||||
// i.e. -(2**63) -> (2**64)-1.
|
// i.e. -(2**63) -> (2**64)-1.
|
||||||
|
|
||||||
// -(2**63) ** Note: compilers see negative literals as negated positive numbers (hence the -1))
|
// -(2**63) ** Note: compilers see negative literals as negated positive numbers (hence the -1))
|
||||||
@ -822,7 +822,7 @@ TEST_CASE("parser class")
|
|||||||
CHECK(accept_helper("9007199254740991"));
|
CHECK(accept_helper("9007199254740991"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("over the edge cases") // issue #178 - Integer conversion to unsigned (incorrect handling of 64 bit integers)
|
SECTION("over the edge cases") // issue #178 - Integer conversion to unsigned (incorrect handling of 64-bit integers)
|
||||||
{
|
{
|
||||||
// While RFC8259, Section 6 specifies a preference for support
|
// While RFC8259, Section 6 specifies a preference for support
|
||||||
// for ranges in range of IEEE 754-2008 binary64 (double precision)
|
// for ranges in range of IEEE 754-2008 binary64 (double precision)
|
||||||
|
|||||||
@ -1521,9 +1521,9 @@ TEST_CASE_TEMPLATE("element access 2 (additional value() tests)", Json, nlohmann
|
|||||||
CHECK(j.value("foo", cpstr) == "bar");
|
CHECK(j.value("foo", cpstr) == "bar");
|
||||||
CHECK(j.value("foo", castr) == "bar");
|
CHECK(j.value("foo", castr) == "bar");
|
||||||
CHECK(j.value("foo", str) == "bar");
|
CHECK(j.value("foo", str) == "bar");
|
||||||
// this test is in fact different than the one below,
|
// this test is in fact different from the one below,
|
||||||
// because of 0 considering const char * overloads
|
// because of 0 considering const char * overloads
|
||||||
// where as any other number does not
|
// whereas any other number does not
|
||||||
CHECK(j.value("baz", 0) == 42);
|
CHECK(j.value("baz", 0) == 42);
|
||||||
CHECK(j.value("baz", 47) == 42);
|
CHECK(j.value("baz", 47) == 42);
|
||||||
CHECK(j.value("baz", integer) == 42);
|
CHECK(j.value("baz", integer) == 42);
|
||||||
|
|||||||
@ -123,8 +123,7 @@ TEST_CASE("JSON pointers")
|
|||||||
CHECK(j.contains(json::json_pointer("/a~1b")));
|
CHECK(j.contains(json::json_pointer("/a~1b")));
|
||||||
CHECK(j.contains(json::json_pointer("/m~0n")));
|
CHECK(j.contains(json::json_pointer("/m~0n")));
|
||||||
|
|
||||||
// unescaped access
|
// unescaped access to nonexisting values yield object creation
|
||||||
// access to nonexisting values yield object creation
|
|
||||||
CHECK(!j.contains(json::json_pointer("/a/b")));
|
CHECK(!j.contains(json::json_pointer("/a/b")));
|
||||||
CHECK_NOTHROW(j[json::json_pointer("/a/b")] = 42);
|
CHECK_NOTHROW(j[json::json_pointer("/a/b")] = 42);
|
||||||
CHECK(j.contains(json::json_pointer("/a/b")));
|
CHECK(j.contains(json::json_pointer("/a/b")));
|
||||||
|
|||||||
@ -1124,7 +1124,7 @@ TEST_CASE("MessagePack")
|
|||||||
// Checking against an expected vector byte by byte is
|
// Checking against an expected vector byte by byte is
|
||||||
// difficult, because no assumption on the order of key/value
|
// difficult, because no assumption on the order of key/value
|
||||||
// pairs are made. We therefore only check the prefix (type and
|
// pairs are made. We therefore only check the prefix (type and
|
||||||
// size and the overall size. The rest is then handled in the
|
// size) and the overall size. The rest is then handled in the
|
||||||
// roundtrip check.
|
// roundtrip check.
|
||||||
CHECK(result.size() == 67); // 1 type, 2 size, 16*4 content
|
CHECK(result.size() == 67); // 1 type, 2 size, 16*4 content
|
||||||
CHECK(result[0] == 0xde); // map 16
|
CHECK(result[0] == 0xde); // map 16
|
||||||
@ -1153,7 +1153,7 @@ TEST_CASE("MessagePack")
|
|||||||
// Checking against an expected vector byte by byte is
|
// Checking against an expected vector byte by byte is
|
||||||
// difficult, because no assumption on the order of key/value
|
// difficult, because no assumption on the order of key/value
|
||||||
// pairs are made. We therefore only check the prefix (type and
|
// pairs are made. We therefore only check the prefix (type and
|
||||||
// size and the overall size. The rest is then handled in the
|
// size) and the overall size. The rest is then handled in the
|
||||||
// roundtrip check.
|
// roundtrip check.
|
||||||
CHECK(result.size() == 458757); // 1 type, 4 size, 65536*7 content
|
CHECK(result.size() == 458757); // 1 type, 4 size, 65536*7 content
|
||||||
CHECK(result[0] == 0xdf); // map 32
|
CHECK(result[0] == 0xdf); // map 32
|
||||||
|
|||||||
@ -442,7 +442,7 @@ TEST_CASE("Markus Kuhn's UTF-8 decoder capability and stress test")
|
|||||||
|
|
||||||
SECTION("4.1 Examples of an overlong ASCII character")
|
SECTION("4.1 Examples of an overlong ASCII character")
|
||||||
{
|
{
|
||||||
// With a safe UTF-8 decoder, all of the following five overlong
|
// With a safe UTF-8 decoder, all the following five overlong
|
||||||
// representations of the ASCII character slash ("/") should be rejected
|
// representations of the ASCII character slash ("/") should be rejected
|
||||||
// like a malformed UTF-8 sequence, for instance by substituting it with
|
// like a malformed UTF-8 sequence, for instance by substituting it with
|
||||||
// a replacement character. If you see a slash below, you do not have a
|
// a replacement character. If you see a slash below, you do not have a
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user