Skip to content

Commit

Permalink
[ulib][unittest] Add BEGIN_HELPER,END_HELPER macros.
Browse files Browse the repository at this point in the history
Change-Id: I6118494b1374872be14af81063bfa34a097a1b0b
  • Loading branch information
xdje42 committed Sep 26, 2016
1 parent 1207c76 commit 9cc10bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions system/ulib/unittest/include/unittest/unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ int unittest_set_verbosity_level(int new_level);
#define BEGIN_TEST current_test_info->all_ok = true
#define END_TEST return current_test_info->all_ok

/*
* BEGIN_HELPER and END_HELPER go in helper programs.
* For example, if a test needs to start a second helper program, and you want
* to use the ASSERT_*,EXPECT_* macros in the helper program, then surround the
* usage with these macros.
*/
#define BEGIN_HELPER \
struct test_info _test_info; \
current_test_info = &_test_info; \
current_test_info->all_ok = true
#define END_HELPER return current_test_info->all_ok

#ifdef __cplusplus
#define AUTO_TYPE_VAR(type) auto&
#else
Expand Down

0 comments on commit 9cc10bc

Please sign in to comment.