MCPcopy Create free account
hub / github.com/couchbase/fleece / checkJSONStr

Method checkJSONStr

Tests/EncoderTests.cc:169–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 }
168
169 void checkJSONStr(std::string json,
170 slice expectedStr,
171 int expectedErr = JSONSL_ERROR_SUCCESS)
172 {
173 json = std::string("[\"") + json + std::string("\"]");
174 JSONConverter j(enc);
175 j.encodeJSON(slice(json));
176 REQUIRE(j.jsonError() == expectedErr);
177 if (j.jsonError()) {
178 enc.reset();
179 return;
180 }
181 endEncoding();
182 REQUIRE(expectedStr); // expected success
183 auto a = checkArray(1);
184 auto output = a->get(0)->asString();
185 REQUIRE(output == slice(expectedStr));
186 }
187
188 void checkJSONStr(std::string json,
189 const char *expectedStr,

Callers

nothing calls this directly

Calls 6

sliceClass · 0.85
encodeJSONMethod · 0.80
jsonErrorMethod · 0.80
resetMethod · 0.45
asStringMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected