diff options
author | Katharina Fey <kookie@spacekookie.de> | 2016-12-13 01:43:18 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2019-06-04 20:21:53 +0200 |
commit | 69fc0d982de64a7d2fdad063fd24a44b16fcab11 (patch) | |
tree | a009f6d47913bf66546e22dad450f34ed15dce32 /test/main.c | |
parent | ced46bac3291118e136f5e3d50bc898b018276fc (diff) |
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
Diffstat (limited to 'test/main.c')
-rw-r--r-- | test/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |