Repository: incubator-mynewt-core Updated Branches: refs/heads/master 62df74fab -> 2bec33d4d
minor revision to be more consistent with test macros 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/04dbf5c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/04dbf5c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/04dbf5c5 Branch: refs/heads/master Commit: 04dbf5c50faf71bb91b25f96fbd7d0b9f46718d6 Parents: 655b79e Author: Paul Dietrich <[email protected]> Authored: Fri Mar 11 12:27:48 2016 -0800 Committer: Paul Dietrich <[email protected]> Committed: Fri Mar 11 13:07:20 2016 -0800 ---------------------------------------------------------------------- libs/json/src/test/test_json.h | 4 ++-- libs/json/src/test/test_json_simple.c | 6 +++--- libs/testutil/include/testutil/testutil.h | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/04dbf5c5/libs/json/src/test/test_json.h ---------------------------------------------------------------------- diff --git a/libs/json/src/test/test_json.h b/libs/json/src/test/test_json.h index 8466213..ea5efcf 100644 --- a/libs/json/src/test/test_json.h +++ b/libs/json/src/test/test_json.h @@ -20,8 +20,8 @@ #ifndef TEST_JSON_H #define TEST_JSON_H -void test_json_simple_encode(void); -void test_json_simple_decode(void); +TEST_CASE_DECL(test_json_simple_encode); +TEST_CASE_DECL(test_json_simple_decode); #endif /* TEST_JSON_H */ http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/04dbf5c5/libs/json/src/test/test_json_simple.c ---------------------------------------------------------------------- diff --git a/libs/json/src/test/test_json_simple.c b/libs/json/src/test/test_json_simple.c index e7046bd..ab2d005 100644 --- a/libs/json/src/test/test_json_simple.c +++ b/libs/json/src/test/test_json_simple.c @@ -17,10 +17,10 @@ * under the License. */ -#include "test_json.h" #include <assert.h> #include <string.h> #include "testutil/testutil.h" +#include "test_json.h" #include "json/json.h" static char *output = "{\"KeyBool\": true,\"KeyInt\": -1234,\"KeyUint\": 1353214,\"KeyString\": \"foobar\",\"KeyStringN\": \"foobarlong\"}"; @@ -35,7 +35,7 @@ static int test_write(void *buf, char* data, int len) { return len; } -void test_json_simple_encode(void) { +TEST_CASE(test_json_simple_encode){ struct json_encoder encoder; struct json_value value; int rc; @@ -145,7 +145,7 @@ test_buf_init(struct test_jbuf *ptjb, char *string) { } /* now test the decode on a string */ -void test_json_simple_decode(void) { +TEST_CASE(test_json_simple_decode){ struct test_jbuf tjb; unsigned int uint_val; int int_val; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/04dbf5c5/libs/testutil/include/testutil/testutil.h ---------------------------------------------------------------------- diff --git a/libs/testutil/include/testutil/testutil.h b/libs/testutil/include/testutil/testutil.h index 2868cdd..2c8000a 100644 --- a/libs/testutil/include/testutil/testutil.h +++ b/libs/testutil/include/testutil/testutil.h @@ -98,6 +98,10 @@ extern jmp_buf tu_case_jb; static void \ TEST_SUITE_##suite_name(void) +/* for creating multiple files with test cases all belonging to the same + * suite */ +#define TEST_CASE_DECL(case_name) int case_name(void); + #define TEST_CASE(case_name) \ static void TEST_CASE_##case_name(void); \ \
