projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3163 from rpv-tomsk/virt-1
[collectd.git]
/
src
/
curl_json_test.c
diff --git
a/src/curl_json_test.c
b/src/curl_json_test.c
index
1e4d3b3
..
6c8640c
100644
(file)
--- a/
src/curl_json_test.c
+++ b/
src/curl_json_test.c
@@
-47,13
+47,15
@@
static cj_t *test_setup(char *json, char *key_path) {
db->curl = (void *)cj_avl_create();
cj_key_t *key = calloc(1, sizeof(*key));
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);
key->path = strdup(key_path);
key->type = strdup("MAGIC");
assert(cj_append_key(db, key) == 0);
- db->state[0].tree = db->tree;
+ cj_tree_entry_t root = {0};
+ root.type = TREE;
+ root.tree = db->tree;
+ db->state[0].entry = &root;
cj_curl_callback(json, strlen(json), 1, db);
#if HAVE_YAJL_V2
cj_curl_callback(json, strlen(json), 1, db);
#if HAVE_YAJL_V2
@@
-62,6
+64,8
@@
static cj_t *test_setup(char *json, char *key_path) {
yajl_parse_complete(db->yajl);
#endif
yajl_parse_complete(db->yajl);
#endif
+ db->state[0].entry = NULL;
+
return db;
}
return db;
}
@@
-135,7
+139,7
@@
DEF_TEST(parse) {
return 0;
}
return 0;
}
-int main(
int argc, char **argv
) {
+int main(
void
) {
cj_submit = test_submit;
RUN_TEST(parse);
cj_submit = test_submit;
RUN_TEST(parse);