MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_charcase.c
Go to the documentation of this file.
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 
10 static void test_case_parse(void);
11 
12 int main(int argc, char **argv)
13 {
14  MC_SET_DEBUG(1);
15 
17 }
18 
19 /* make sure only lowercase forms are parsed in strict mode */
20 static void test_case_parse()
21 {
22  struct json_tokener *tok;
23  json_object *new_obj;
24 
25  tok = json_tokener_new();
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 }
struct json_tokener * json_tokener_new(void)
Definition: json_tokener.c:123
void json_tokener_free(struct json_tokener *tok)
Definition: json_tokener.c:128
void json_tokener_set_flags(struct json_tokener *tok, int flags)
#define JSON_TOKENER_STRICT
Definition: json_tokener.h:110
int main(int argc, char **argv)
Definition: test_charcase.c:12
#define MC_SET_DEBUG(x)
Definition: debug.h:60
struct json_object * json_tokener_parse_ex(struct json_tokener *tok, const char *str, int len)
Definition: json_tokener.c:273
static void test_case_parse(void)
Definition: test_charcase.c:20