MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / shouldOverflow

Function shouldOverflow

extras/tests/JsonVariant/overflow.cpp:17–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16template <typename TOut, typename TIn>
17void shouldOverflow(TIn value) {
18 JsonDocument doc;
19 JsonVariant var = doc.to<JsonVariant>();
20 var.set(value);
21 REQUIRE(var.as<TOut>() == 0);
22 REQUIRE(var.is<TOut>() == false);
23}
24
25TEST_CASE("Handle integer overflow in stored integer") {
26 SECTION("int8_t") {

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected