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

Function common_tests

extras/tests/Misc/StringWriter.cpp:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27template <typename StringWriter, typename String>
28void common_tests(StringWriter& writer, const String& output) {
29 SECTION("InitialState") {
30 REQUIRE(std::string("") == output);
31 }
32
33 SECTION("EmptyString") {
34 REQUIRE(0 == print(writer, ""));
35 REQUIRE(std::string("") == output);
36 }
37
38 SECTION("OneString") {
39 REQUIRE(4 == print(writer, "ABCD"));
40 REQUIRE("ABCD"_s == output);
41 }
42
43 SECTION("TwoStrings") {
44 REQUIRE(4 == print(writer, "ABCD"));
45 REQUIRE(4 == print(writer, "EFGH"));
46 REQUIRE("ABCDEFGH"_s == output);
47 }
48}
49
50TEST_CASE("StaticStringWriter") {
51 char output[20] = {0};

Callers 1

StringWriter.cppFile · 0.85

Calls 2

SECTIONFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected