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

Function convertToJson

extras/tests/Misc/issue2129.cpp:39–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38template <typename T>
39void convertToJson(const Nullable<T>& src, JsonVariant dst) {
40 if (src.is_valid()) {
41 dst.set(src.value());
42 } else {
43 dst.clear();
44 }
45}
46
47TEST_CASE("Issue #2129") {
48 Nullable<float> nullable_value = Nullable<float>{123.4f};

Callers

nothing calls this directly

Calls 4

is_validMethod · 0.80
setMethod · 0.80
valueMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected