1#include <stdio.h>
2#include <stdlib.h>
3#include <stddef.h>
4#include <string.h>
5#include <assert.h>
6
7#include "json.h"
8#include "json_tokener.h"
9
10static void test_case_parse(void);
11
12int main(int argc, char **argv)
13{
14	MC_SET_DEBUG(1);
15
16	test_case_parse();
17}
18
19/* make sure only lowercase forms are parsed in strict mode */
20static void test_case_parse()
21{
22	struct json_tokener *tok;
23	json_object *new_obj;
24
25	tok = json_tokener_new();
26	json_tokener_set_flags(tok, JSON_TOKENER_STRICT);
27
28	new_obj = json_tokener_parse_ex(tok, "True", 4);
29	assert (new_obj == NULL);
30
31	new_obj = json_tokener_parse_ex(tok, "False", 5);
32	assert (new_obj == NULL);
33
34	new_obj = json_tokener_parse_ex(tok, "Null", 4);
35	assert (new_obj == NULL);
36
37	printf("OK\n");
38
39	json_tokener_free(tok);
40}
41