diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-10-09 13:22:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-10-22 09:32:13 -0400 |
commit | 0da349aa5ebc6d33c92a4f979002c2b0282afc41 (patch) | |
tree | eb83c6cc68cc77b5191c3b1225054f2e041bcc7f /src/test/test.h | |
parent | 0b862a7616cfac4db2c85288abf59916b662f03b (diff) | |
download | tor-0da349aa5ebc6d33c92a4f979002c2b0282afc41.tar.gz tor-0da349aa5ebc6d33c92a4f979002c2b0282afc41.zip |
test.h: Use COCCI to suppress macros Coccinelle does not understand.
Diffstat (limited to 'src/test/test.h')
-rw-r--r-- | src/test/test.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test.h b/src/test/test.h index d6a1d19ea1..59c4bc7978 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -37,6 +37,7 @@ #define test_memeq_hex(expr1, hex) test_mem_op_hex(expr1, OP_EQ, hex) +#ifndef COCCI #define tt_double_op(a,op,b) \ tt_assert_test_type(a,b,#a" "#op" "#b,double,(val1_ op val2_),"%g", \ TT_EXIT_TEST_FUNCTION) @@ -64,6 +65,7 @@ tt_assert_test_fmt_type(a,b,#a" "#op" "#b,int64_t,(val1_ op val2_), \ int64_t, "%"PRId64, \ {print_ = (int64_t) value_;}, {}, TT_EXIT_TEST_FUNCTION) +#endif /** * Declare that the test is done, even though no tt___op() calls were made. @@ -145,6 +147,7 @@ void free_pregenerated_keys(void); #define NAME_TEST_(name) #name #define NAME_TEST(name) NAME_TEST_(name) #define ASPECT(test_module, test_name) US2_CONCAT_2__(test_module, test_name) +#ifndef COCCI #define TEST_CASE(function) \ { \ NAME_TEST(function), \ @@ -161,15 +164,18 @@ void free_pregenerated_keys(void); NULL, \ NULL, \ } +#endif #define NS(name) US_CONCAT_3_(NS_MODULE, NS_SUBMODULE, name) #define NS_FULL(module, submodule, name) US_CONCAT_3_(module, submodule, name) #define CALLED(mock_name) US_CONCAT_2_(NS(mock_name), called) +#ifndef COCCI #define NS_DECL(retval, mock_fn, args) \ extern int CALLED(mock_fn); \ static retval NS(mock_fn) args; int CALLED(mock_fn) = 0 #define NS_MOCK(name) MOCK(name, NS(name)) +#endif #define NS_UNMOCK(name) UNMOCK(name) extern const struct testcase_setup_t passthrough_setup; |