mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-24 15:14:06 +00:00
unit: Support check v0.13.0 and later
Function name no longer needs to be fed separately when adding tests. Also fix collision of non-static net_test variables in dhcp and netif tests.
This commit is contained in:
parent
9b1056ef0e
commit
ea111c511e
@ -9,7 +9,7 @@
|
||||
#error "This tests needs LWIP_NETIF_EXT_STATUS_CALLBACK enabled"
|
||||
#endif
|
||||
|
||||
struct netif net_test;
|
||||
static struct netif net_test;
|
||||
|
||||
|
||||
/* Setups/teardown functions */
|
||||
|
@ -18,7 +18,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
struct netif net_test;
|
||||
static struct netif net_test;
|
||||
|
||||
static const u8_t broadcast[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0)
|
||||
#define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL)
|
||||
|
||||
#if (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION < 13)
|
||||
typedef struct {
|
||||
TFun func;
|
||||
const char *name;
|
||||
@ -24,6 +25,15 @@ typedef struct {
|
||||
#define tcase_add_named_test(tc,tf) \
|
||||
_tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1)
|
||||
|
||||
#else
|
||||
/* From 0.13.0 check keeps track of the method name internally */
|
||||
typedef const TTest * testfunc;
|
||||
|
||||
#define TESTFUNC(x) x
|
||||
|
||||
#define tcase_add_named_test(tc,tf) tcase_add_test(tc,tf)
|
||||
#endif
|
||||
|
||||
/** typedef for a function returning a test suite */
|
||||
typedef Suite* (suite_getter_fn)(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user