X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fceph_test.c;h=199d40ec9a429d8c5fac6fb99b48b7968bd59db2;hb=183223fd3c46819703437f9989f0fa12491aa4d0;hp=acab179ed66c231b75f91ca6883c3e360756929a;hpb=8dfaf98cde62e42d4c245400c68ae9c825a2fe68;p=collectd.git diff --git a/src/ceph_test.c b/src/ceph_test.c index acab179e..199d40ec 100644 --- a/src/ceph_test.c +++ b/src/ceph_test.c @@ -24,8 +24,8 @@ struct case_s { - char *key; - char *value; + const char *key; + const char *value; }; typedef struct case_s case_t; @@ -136,22 +136,23 @@ DEF_TEST(traverse_json) yajl_handle hndl; #if HAVE_YAJL_V2 hndl = yajl_alloc (&callbacks, NULL, &ctx); - CHECK_ZERO (traverse_json ((unsigned char *) json, (uint32_t) strlen (json), hndl)); + CHECK_ZERO (traverse_json ((const unsigned char *) json, (uint32_t) strlen (json), hndl)); CHECK_ZERO (yajl_complete_parse (hndl)); #else hndl = yajl_alloc (&callbacks, NULL, NULL, &ctx); - CHECK_ZERO (traverse_json ((unsigned char *) json, (uint32_t) strlen (json), hndl)); + CHECK_ZERO (traverse_json ((const unsigned char *) json, (uint32_t) strlen (json), hndl)); CHECK_ZERO (yajl_parse_complete (hndl)); #endif + yajl_free (hndl); return 0; } DEF_TEST(parse_keys) { struct { - char *str; - char *want; + const char *str; + const char *want; } cases[] = { {"WBThrottle.bytes_dirtied.description.bytes_wb.description.ios_dirtied.description.ios_wb.type", "WBThrottle.bytesDirtied.description.bytesWb.description.iosDirt"}, {"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},