MYNEWT-672 json encode test assumes buffer is 0ed
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/c87fac5c Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c87fac5c Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c87fac5c Branch: refs/heads/nrf_cputime Commit: c87fac5c7da225d1aaab6965109ebe1ec9a00c57 Parents: 90b34f8 Author: Christopher Collins <ccoll...@apache.org> Authored: Wed Mar 15 18:53:05 2017 -0700 Committer: Christopher Collins <ccoll...@apache.org> Committed: Wed Mar 15 18:53:05 2017 -0700 ---------------------------------------------------------------------- encoding/json/test/src/testcases/json_simple_encode.c | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c87fac5c/encoding/json/test/src/testcases/json_simple_encode.c ---------------------------------------------------------------------- diff --git a/encoding/json/test/src/testcases/json_simple_encode.c b/encoding/json/test/src/testcases/json_simple_encode.c index 3aee7a6..79a77b4 100644 --- a/encoding/json/test/src/testcases/json_simple_encode.c +++ b/encoding/json/test/src/testcases/json_simple_encode.c @@ -79,6 +79,8 @@ TEST_CASE(test_json_simple_encode) rc = json_encode_object_finish(&encoder); TEST_ASSERT(rc == 0); + bigbuf[buf_index] = '\0'; + /* does it match what we expect it to */ rc = strcmp(bigbuf, output); TEST_ASSERT(rc == 0);