mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
test/tinytest_macros: add new one tt_nstr_op()
This commit is contained in:
parent
0abd0393ea
commit
bd19a28ac4
@ -166,6 +166,12 @@
|
|||||||
tt_assert_test_type(a,b,#a" "#op" "#b,const 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)
|
||||||
|
|
||||||
|
/** XXX: have some issues with printing this non-NUL terminated strings */
|
||||||
|
#define tt_nstr_op(n,a,op,b) \
|
||||||
|
tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *, \
|
||||||
|
(val1_ && val2_ && strncmp(val1_,val2_,(n)) op 0),"<%s>", \
|
||||||
|
TT_EXIT_TEST_FUNCTION)
|
||||||
|
|
||||||
#define tt_str_op(a,op,b) \
|
#define tt_str_op(a,op,b) \
|
||||||
tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *, \
|
tt_assert_test_type_opt(a,b,#a" "#op" "#b,const char *, \
|
||||||
(val1_ && val2_ && strcmp(val1_,val2_) op 0),"<%s>", \
|
(val1_ && val2_ && strcmp(val1_,val2_) op 0),"<%s>", \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user