test/tinytest_macros: add new one tt_nstr_op()

This commit is contained in:
Azat Khuzhin 2016-04-21 02:11:26 +03:00
parent 0abd0393ea
commit bd19a28ac4

View File

@ -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>", \