Lines Matching refs:tokens

86 	jsmntok_t tokens[10];  in test_simple()  local
91 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_simple()
93 check(TOKEN_EQ(tokens[0], 0, 8, JSMN_OBJECT)); in test_simple()
94 check(TOKEN_EQ(tokens[1], 2, 3, JSMN_STRING)); in test_simple()
95 check(TOKEN_EQ(tokens[2], 6, 7, JSMN_PRIMITIVE)); in test_simple()
97 check(TOKEN_STRING(js, tokens[0], js)); in test_simple()
98 check(TOKEN_STRING(js, tokens[1], "a")); in test_simple()
99 check(TOKEN_STRING(js, tokens[2], "0")); in test_simple()
103 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_simple()
108 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_simple()
335 jsmntok_t tokens[10]; in test_objects_arrays() local
340 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_objects_arrays()
345 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_objects_arrays()
350 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_objects_arrays()
355 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_objects_arrays()
364 jsmntok_t tokens[128]; in test_issue_22() local
376 r = jsmn_parse(&p, js, strlen(js), tokens, 128); in test_issue_22()
379 for (i = 1; tokens[i].end < tokens[0].end; i++) { in test_issue_22()
380 if (tokens[i].type == JSMN_STRING || tokens[i].type == JSMN_PRIMITIVE) { in test_issue_22()
381 printf("%.*s\n", tokens[i].end - tokens[i].start, js + tokens[i].start); in test_issue_22()
382 } else if (tokens[i].type == JSMN_ARRAY) { in test_issue_22()
383 printf("[%d elems]\n", tokens[i].size); in test_issue_22()
384 } else if (tokens[i].type == JSMN_OBJECT) { in test_issue_22()
385 printf("{%d elems}\n", tokens[i].size); in test_issue_22()
387 TOKEN_PRINT(tokens[i]); in test_issue_22()
396 jsmntok_t tokens[10]; in test_unicode_characters() local
402 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
407 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
412 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
417 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
422 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
427 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
432 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_unicode_characters()
442 jsmntok_t tokens[10]; in test_input_length() local
447 r = jsmn_parse(&p, js, 8, tokens, 10); in test_input_length()
449 check(TOKEN_STRING(js, tokens[0], "{\"a\": 0}")); in test_input_length()
450 check(TOKEN_STRING(js, tokens[1], "a")); in test_input_length()
451 check(TOKEN_STRING(js, tokens[2], "0")); in test_input_length()
507 jsmntok_t tokens[10]; in test_keyvalue() local
512 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
514 check(tokens[0].size == 2); /* two keys */ in test_keyvalue()
515 check(tokens[1].size == 1 && tokens[3].size == 1); /* one value per key */ in test_keyvalue()
516 check(tokens[2].size == 0 && tokens[4].size == 0); /* values have zero size */ in test_keyvalue()
520 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
525 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
530 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
535 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
541 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_keyvalue()
572 jsmntok_t tokens[10]; in test_nonstrict() local
577 r = jsmn_parse(&p, js, 4, tokens, 10); in test_nonstrict()
579 check(TOKEN_STRING(js, tokens[0], "a")); in test_nonstrict()
580 check(TOKEN_STRING(js, tokens[1], "0")); in test_nonstrict()
584 r = jsmn_parse(&p, js, strlen(js), tokens, 10); in test_nonstrict()