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

Function checkWriteInteger

extras/tests/TextFormatter/writeInteger.cpp:15–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename T>
15void checkWriteInteger(T value, std::string expected) {
16 char output[64] = {0};
17 StaticStringWriter sb(output, sizeof(output));
18 TextFormatter<StaticStringWriter> writer(sb);
19 writer.writeInteger<T>(value);
20 REQUIRE(expected == output);
21 REQUIRE(writer.bytesWritten() == expected.size());
22}
23
24TEST_CASE("int8_t") {
25 checkWriteInteger<int8_t>(0, "0");

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected