diff options
author | Joe Hildebrand <joe-github@cursive.net> | 2015-08-26 10:37:02 -0600 |
---|---|---|
committer | Joe Hildebrand <joe-github@cursive.net> | 2015-08-26 10:37:02 -0600 |
commit | 45e9ad906f2759b96978deeb44c4c0e33ce9ab02 (patch) | |
tree | 5e0ee40f1d7545c89616ead021c67fa453af18cc /test | |
parent | 0303a1e22d6d70f8a4376e61cbed09a2ce52f04b (diff) | |
download | platform_external_cn-cbor-45e9ad906f2759b96978deeb44c4c0e33ce9ab02.tar.gz platform_external_cn-cbor-45e9ad906f2759b96978deeb44c4c0e33ce9ab02.tar.bz2 platform_external_cn-cbor-45e9ad906f2759b96978deeb44c4c0e33ce9ab02.zip |
Remove extraneous const's, fix tests to match, and add an assert to cn_cbor_free to ensure we're at the root. Freeing NULL is still allowed as a no-op.
Diffstat (limited to 'test')
-rw-r--r-- | test/cbor_test.c | 12 | ||||
-rw-r--r-- | test/test.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/cbor_test.c b/test/cbor_test.c index ebd5edd..3326497 100644 --- a/test/cbor_test.c +++ b/test/cbor_test.c @@ -111,7 +111,7 @@ CTEST(cbor, parse) "9f009f00ff00ff", // [_ 0, [_ 0], 0] "bf61610161629f0203ffff", // {_ "a": 1, "b": [_ 2, 3]} }; - const cn_cbor *cb; + cn_cbor *cb; buffer b; size_t i; unsigned char encoded[1024]; @@ -159,7 +159,7 @@ CTEST(cbor, parse_normalize) "fb3e78000000000000", "fa33c00000", // 8.940696716308594e-08 "fb3e80000000000000", "f90002", // 1.1920928955078125e-07 }; - const cn_cbor *cb; + cn_cbor *cb; buffer b, b2; size_t i; unsigned char encoded[1024]; @@ -221,7 +221,7 @@ CTEST(cbor, fail) {"1c", CN_CBOR_ERR_RESERVED_AI}, {"7f4100", CN_CBOR_ERR_WRONG_NESTING_IN_INDEF_STRING}, }; - const cn_cbor *cb; + cn_cbor *cb; buffer b; size_t i; uint8_t buf[10]; @@ -253,7 +253,7 @@ CTEST(cbor, float) "f9fc00", // -Inf "f97c00", // Inf }; - const cn_cbor *cb; + cn_cbor *cb; buffer b; size_t i; unsigned char encoded[1024]; @@ -276,8 +276,8 @@ CTEST(cbor, float) CTEST(cbor, getset) { buffer b; - const cn_cbor *cb; - const cn_cbor *val; + cn_cbor *cb; + cn_cbor *val; cn_cbor_errback err; ASSERT_TRUE(parse_hex("a40000436363630262626201616100", &b)); diff --git a/test/test.c b/test/test.c index 263f9fe..d24992f 100644 --- a/test/test.c +++ b/test/test.c @@ -115,7 +115,7 @@ int main() { char *bufend; unsigned char *s = load_file("cases.cbor", &end); printf("%zd\n", end-s); - const cn_cbor *cb = cn_cbor_decode(s, end-s CBOR_CONTEXT_PARAM, 0); + cn_cbor *cb = cn_cbor_decode(s, end-s CBOR_CONTEXT_PARAM, 0); if (cb) { dump(cb, buf, &bufend, 0); *bufend = 0; |