QMI: add uqmi tool with all depends
[tomato.git] / release / src / router / libjson-c / tests / test_charcase.c
blob936afeee835ba2b9d931f17e59cafc69de62936e
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stddef.h>
4 #include <string.h>
5 #include <assert.h>
7 #include "json.h"
8 #include "json_tokener.h"
10 static void test_case_parse(void);
12 int main(int argc, char **argv)
14 MC_SET_DEBUG(1);
16 test_case_parse();
19 /* make sure only lowercase forms are parsed in strict mode */
20 static void test_case_parse()
22 struct json_tokener *tok;
23 json_object *new_obj;
25 tok = json_tokener_new();
26 json_tokener_set_flags(tok, JSON_TOKENER_STRICT);
28 new_obj = json_tokener_parse_ex(tok, "True", 4);
29 assert (new_obj == NULL);
31 new_obj = json_tokener_parse_ex(tok, "False", 5);
32 assert (new_obj == NULL);
34 new_obj = json_tokener_parse_ex(tok, "Null", 4);
35 assert (new_obj == NULL);
37 printf("OK\n");
39 json_tokener_free(tok);