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

Function checkNumericType

extras/tests/JsonVariant/types.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template <typename T>
20void checkNumericType() {
21 JsonDocument docMin, docMax;
22 JsonVariant variantMin = docMin.to<JsonVariant>();
23 JsonVariant variantMax = docMax.to<JsonVariant>();
24
25 T min = std::numeric_limits<T>::min();
26 T max = std::numeric_limits<T>::max();
27
28 variantMin.set(min);
29 variantMax.set(max);
30
31 REQUIRE(min == variantMin.as<T>());
32 REQUIRE(max == variantMax.as<T>());
33}
34
35TEST_CASE("JsonVariant set()/get()") {
36 SpyingAllocator spy;

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected