X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json_test.c;h=4b9846607f794e3a95c12d171fc3fccea7b69686;hb=307bf74a8cef765fcd5d788f6aad5b2e9bdf670b;hp=1e4d3b3bb0db7a96d151238a79e1c271591f36f9;hpb=b7ff429c9f1440bac83eaa26c75945742ea70c0b;p=collectd.git diff --git a/src/curl_json_test.c b/src/curl_json_test.c index 1e4d3b3b..4b984660 100644 --- a/src/curl_json_test.c +++ b/src/curl_json_test.c @@ -47,13 +47,14 @@ static cj_t *test_setup(char *json, char *key_path) { db->curl = (void *)cj_avl_create(); cj_key_t *key = calloc(1, sizeof(*key)); - key->magic = CJ_KEY_MAGIC; key->path = strdup(key_path); key->type = strdup("MAGIC"); assert(cj_append_key(db, key) == 0); - db->state[0].tree = db->tree; + db->state[0].entry = &(cj_tree_entry_t){ + .type = TREE, .tree = db->tree, + }; cj_curl_callback(json, strlen(json), 1, db); #if HAVE_YAJL_V2 @@ -62,6 +63,8 @@ static cj_t *test_setup(char *json, char *key_path) { yajl_parse_complete(db->yajl); #endif + db->state[0].entry = NULL; + return db; }