You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by pe...@apache.org on 2016/12/19 23:02:58 UTC

incubator-mynewt-core git commit: MYNEWT-139: refactor json unit test for testbench

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop dfc671743 -> 963c137ac


MYNEWT-139: refactor json unit test for testbench

Quick refactoring of json unit test for documentation purposes.


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/963c137a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/963c137a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/963c137a

Branch: refs/heads/develop
Commit: 963c137ac9380f0ed1408053aa6390cc6390e2c7
Parents: dfc6717
Author: Peter Snyder <pe...@apache.org>
Authored: Mon Dec 19 15:01:38 2016 -0800
Committer: Peter Snyder <pe...@apache.org>
Committed: Mon Dec 19 15:01:38 2016 -0800

----------------------------------------------------------------------
 encoding/json/test/src/test_json.h       | 7 ++++++-
 encoding/json/test/src/test_json_utils.c | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/963c137a/encoding/json/test/src/test_json.h
----------------------------------------------------------------------
diff --git a/encoding/json/test/src/test_json.h b/encoding/json/test/src/test_json.h
index bbdbf36..aa1a4b3 100644
--- a/encoding/json/test/src/test_json.h
+++ b/encoding/json/test/src/test_json.h
@@ -34,7 +34,12 @@ char *output1;
 char *outputboolspace;
 char *outputboolempty;
 
-char bigbuf[512];
+#if MYNEWT_VAL(SELFTEST)
+#define JSON_BIGBUF_SIZE    192
+char bigbuf[JSON_BIGBUF_SIZE];
+#else
+char *bigbuf;
+#endif
 int buf_index;
 
 /* a test structure to hold the json flat buffer and pass bytes

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/963c137a/encoding/json/test/src/test_json_utils.c
----------------------------------------------------------------------
diff --git a/encoding/json/test/src/test_json_utils.c b/encoding/json/test/src/test_json_utils.c
index 8633bf3..f641afd 100644
--- a/encoding/json/test/src/test_json_utils.c
+++ b/encoding/json/test/src/test_json_utils.c
@@ -28,7 +28,11 @@ char *output1 ="{\"KeyBoolArr\": [true, false], \"KeyUintArr\": [0, 65535, 42949
 char *outputboolspace = "{\"KeyBoolArr\": [    true    ,    false,true         ]}";
 char *outputboolempty = "{\"KeyBoolArr\": , \"KeyBoolArr\": [  ]}";
 
-char bigbuf[512];
+#if MYNEWT_VAL(SELFTEST)
+char bigbuf[JSON_BIGBUF_SIZE];
+#else
+char *bigbuf;
+#endif
 int buf_index;
 
 int