#define ARDUINOJSON_ENABLE_NAN 0 #include #include #include TEST_CASE("ARDUINOJSON_ENABLE_NAN == 0") { JsonDocument doc; JsonObject root = doc.to(); SECTION("serializeJson()") { root["X"] = std::numeric_limits::signaling_NaN(); std::string json; serializeJson(doc, json); REQUIRE(json == "{\"X\":null}"); } SECTION("deserializeJson()") { DeserializationError err = deserializeJson(doc, "{\"X\":NaN}"); REQUIRE(err == DeserializationError::InvalidInput); } }