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

Function test_toks

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

Source from the content-addressed store, hash-verified

239}
240
241static void test_toks(const struct json *j, ...)
242{
243 const jsmntok_t * tok = j->toks + 1;
244 const char *value;
245 va_list(ap);
246 va_start(ap, j);
247 while ((value = va_arg(ap, char *)) != NULL) {
248 if (tok->type == JSMN_OBJECT)
249 assert(streq(value, "{"));
250 else if (tok->type == JSMN_ARRAY)
251 assert(streq(value, "["));
252 else
253 assert(json_tok_streq(j->buffer, tok, value));
254 tok++;
255 }
256}
257
258static void sanity(void)
259{

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.85

Tested by

no test coverage detected