Update to a more recent tinytest_macros.

This one has less of a tendency to suppress important type warnings.
This commit is contained in:
Nick Mathewson 2014-05-08 13:21:49 -04:00
parent 28db827efa
commit 8da5a1864c
2 changed files with 8 additions and 8 deletions

View File

@ -1534,9 +1534,9 @@ test_evbuffer_callbacks(void *ptr)
tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2)); tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2));
evbuffer_validate(buf); evbuffer_validate(buf);
tt_str_op(evbuffer_pullup(buf_out1, -1), ==, tt_str_op((const char *) evbuffer_pullup(buf_out1, -1), ==,
"0->36; 36->26; 26->31; 31->38; "); "0->36; 36->26; 26->31; 31->38; ");
tt_str_op(evbuffer_pullup(buf_out2, -1), ==, tt_str_op((const char *) evbuffer_pullup(buf_out2, -1), ==,
"0->36; 31->38; 38->0; 0->1; "); "0->36; 31->38; 38->0; 0->1; ");
evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1)); evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1));
evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2)); evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2));
@ -1552,7 +1552,7 @@ test_evbuffer_callbacks(void *ptr)
tt_uint_op(evbuffer_get_length(buf_out2), ==, 0); tt_uint_op(evbuffer_get_length(buf_out2), ==, 0);
evbuffer_setcb(buf, NULL, NULL); evbuffer_setcb(buf, NULL, NULL);
evbuffer_add_printf(buf, "This will not."); evbuffer_add_printf(buf, "This will not.");
tt_str_op(evbuffer_pullup(buf, -1), ==, "This will not."); tt_str_op((const char *) evbuffer_pullup(buf, -1), ==, "This will not.");
evbuffer_validate(buf); evbuffer_validate(buf);
evbuffer_drain(buf, evbuffer_get_length(buf)); evbuffer_drain(buf, evbuffer_get_length(buf));
evbuffer_validate(buf); evbuffer_validate(buf);

View File

@ -113,8 +113,8 @@
#define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \ #define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \
setup_block,cleanup_block,die_on_fail) \ setup_block,cleanup_block,die_on_fail) \
TT_STMT_BEGIN \ TT_STMT_BEGIN \
type val1_ = (type)(a); \ type val1_ = (a); \
type val2_ = (type)(b); \ type val2_ = (b); \
int tt_status_ = (test); \ int tt_status_ = (test); \
if (!tt_status_ || tinytest_get_verbosity_()>1) { \ if (!tt_status_ || tinytest_get_verbosity_()>1) { \
printf_type print_; \ printf_type print_; \
@ -163,7 +163,7 @@
(val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION) (val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION)
#define tt_ptr_op(a,op,b) \ #define tt_ptr_op(a,op,b) \
tt_assert_test_type(a,b,#a" "#op" "#b,void*, \ tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \
(val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION) (val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION)
#define tt_str_op(a,op,b) \ #define tt_str_op(a,op,b) \
@ -173,7 +173,7 @@
#define tt_mem_op(expr1, op, expr2, len) \ #define tt_mem_op(expr1, op, expr2, len) \
tt_assert_test_fmt_type(expr1,expr2,#expr1" "#op" "#expr2, \ tt_assert_test_fmt_type(expr1,expr2,#expr1" "#op" "#expr2, \
const char *, \ const void *, \
(val1_ && val2_ && memcmp(val1_, val2_, len) op 0), \ (val1_ && val2_ && memcmp(val1_, val2_, len) op 0), \
char *, "%s", \ char *, "%s", \
{ print_ = tinytest_format_hex_(value_, (len)); }, \ { print_ = tinytest_format_hex_(value_, (len)); }, \
@ -189,7 +189,7 @@
(val1_ op val2_),"%lu",(void)0) (val1_ op val2_),"%lu",(void)0)
#define tt_want_ptr_op(a,op,b) \ #define tt_want_ptr_op(a,op,b) \
tt_assert_test_type(a,b,#a" "#op" "#b,void*, \ tt_assert_test_type(a,b,#a" "#op" "#b,const void*, \
(val1_ op val2_),"%p",(void)0) (val1_ op val2_),"%p",(void)0)
#define tt_want_str_op(a,op,b) \ #define tt_want_str_op(a,op,b) \