From 69fc0d982de64a7d2fdad063fd24a44b16fcab11 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Tue, 13 Dec 2016 01:43:18 +0100 Subject: Fixing a few parser issues that prevented it from working properly. Includes: - Now NULL terminates all inputs pre-emptively - Can now properly parse numerical values - Calculates heap memory field size for tokens arrayproperly --- test/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/main.c') diff --git a/test/main.c b/test/main.c index 63ff521..3a44129 100644 --- a/test/main.c +++ b/test/main.c @@ -47,7 +47,7 @@ int main(int argn, char **argv) // start timer gettimeofday(&t1, NULL); -#define PATH "/home/spacekookie/Downloads/generated.json" +#define PATH "/home/spacekookie/Downloads/MOCK_DATA.json" /* Open the file and seek through it for length */ FILE *f = fopen(PATH, "r"); @@ -61,6 +61,10 @@ int main(int argn, char **argv) fread(json, file_size, 1, f); fclose(f); +// char *json = "{ \"some_key\": \"some_value\" }"; + + printf("Raw json data. %s", json); + dtree *recov; dtree_decode_json(&recov, json, file_size); -- cgit v1.2.3