more test cases for CBOR

This commit is contained in:
Niels Lohmann 2016-12-07 23:14:37 +01:00
parent 3a0f5398a2
commit 81a4272444

View File

@ -629,6 +629,21 @@ TEST_CASE("CBOR")
CHECK(json::from_cbor(result) == j); CHECK(json::from_cbor(result) == j);
} }
} }
SECTION("half-precision float (edge cases)")
{
SECTION("infinity")
{
json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c, 0x00}));
CHECK(j == nullptr);
}
SECTION("NaN")
{
json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c, 0x01}));
CHECK(j == nullptr);
}
}
} }
SECTION("string") SECTION("string")