8 #define TEST_SETNAME(name) test_setname(name)
9 #define TEST_STEP(name) do{}while(0) //test_setstep(name)
10 #define TEST_ASSERT(cnd) do{if(!(cnd)) {test_assertion_fail(__FILE__,__LINE__,"%s",#cnd);return false;}}while(0)
11 #define TEST_ASSERT_REL(a,r,b) do{long long a_val=(a),b_val=(b);if(!(a_val r b_val)) {test_assertion_fail(__FILE__,__LINE__,"%s(0x%llx)%s%s(0x%llx)",#a,a_val,#r,#b,b_val);return false;}}while(0)
12 #define TEST_WARN(msg...) test_message(__FILE__,__LINE__,msg)
14 extern void test_setname(const char *name);
15 extern void test_message(const char *filename, int line, const char *msg, ...);
16 extern void test_assertion_fail(const char *filename, int line, const char *test, ...);
17 extern void test_trace(const char *msg, ...);
18 extern void test_trace_hexdump(const char *hdr, const void *data, size_t len);
20 // Some helpful macros
21 // - They require some names to be present
23 size_t rxlen, ofs, len; \
24 do { ofs = 0; ofs = ofs; len = 0; len = len; } while(0);\
27 TEST_SETNAME(__func__);\
30 #define TEST_ASSERT_rx() TEST_ASSERT( rxlen = Net_Receive(0, sizeof(rxbuf), rxbuf, ERX_TIMEOUT) )
31 #define TEST_ASSERT_no_rx() TEST_ASSERT( Net_Receive(0, sizeof(rxbuf), rxbuf, NRX_TIMEOUT) == 0 )