Update deps (#482)

This commit is contained in:
iranl
2024-10-09 15:06:50 +02:00
committed by GitHub
parent 3207cde395
commit 3f0ef34c9e
95 changed files with 2250 additions and 797 deletions

View File

@@ -199,3 +199,44 @@ TEST_CASE(
REQUIRE(err == DeserializationError::NoMemory);
}
}
TEST_CASE(
"deserializeMsgPack() returns NoMemory if extension allocation fails") {
JsonDocument doc(FailingAllocator::instance());
SECTION("uint32_t should pass") {
auto err = deserializeMsgPack(doc, "\xceXXXX");
REQUIRE(err == DeserializationError::Ok);
}
SECTION("uint64_t should fail") {
auto err = deserializeMsgPack(doc, "\xcfXXXXXXXX");
REQUIRE(err == DeserializationError::NoMemory);
}
SECTION("int32_t should pass") {
auto err = deserializeMsgPack(doc, "\xd2XXXX");
REQUIRE(err == DeserializationError::Ok);
}
SECTION("int64_t should fail") {
auto err = deserializeMsgPack(doc, "\xd3XXXXXXXX");
REQUIRE(err == DeserializationError::NoMemory);
}
SECTION("float should pass") {
auto err = deserializeMsgPack(doc, "\xcaXXXX");
REQUIRE(err == DeserializationError::Ok);
}
SECTION("double should fail") {
auto err = deserializeMsgPack(doc, "\xcbXXXXXXXX");
REQUIRE(err == DeserializationError::NoMemory);
}
}