MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_toks

Function test_toks

common/test/run-json_remove.c:210–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static void test_toks(const struct json *j, ...)
211{
212 const jsmntok_t * tok = j->toks + 1;
213 const char *value;
214 va_list(ap);
215 va_start(ap, j);
216 while ((value = va_arg(ap, char *)) != NULL) {
217 if (tok->type == JSMN_OBJECT)
218 assert(streq(value, "{"));
219 else if (tok->type == JSMN_ARRAY)
220 assert(streq(value, "["));
221 else
222 assert(json_tok_streq(j->buffer, tok, value));
223 tok++;
224 }
225}
226
227static void sanity(void)
228{

Callers 5

remove_firstFunction · 0.85
remove_lastFunction · 0.85
remove_multipleFunction · 0.85
remove_complexFunction · 0.85
remove_inside_objFunction · 0.85

Calls 1

json_tok_streqFunction · 0.70

Tested by

no test coverage detected