mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 00:14:02 +00:00
tcp unit tests: don't break later tests relying on loopif
This commit is contained in:
parent
3fd8440ab9
commit
a42d1678eb
@ -29,10 +29,16 @@ test_tcp_tmr(void)
|
||||
}
|
||||
|
||||
/* Setups/teardown functions */
|
||||
static struct netif *old_netif_list;
|
||||
static struct netif *old_netif_default;
|
||||
|
||||
static void
|
||||
tcp_setup(void)
|
||||
{
|
||||
old_netif_list = netif_list;
|
||||
old_netif_default = netif_default;
|
||||
netif_list = NULL;
|
||||
netif_default = NULL;
|
||||
/* reset iss to default (6510) */
|
||||
tcp_ticks = 0;
|
||||
tcp_ticks = 0 - (tcp_next_iss(NULL) - 6510);
|
||||
@ -49,6 +55,9 @@ tcp_teardown(void)
|
||||
netif_list = NULL;
|
||||
netif_default = NULL;
|
||||
tcp_remove_all();
|
||||
/* restore netif_list for next tests (e.g. loopif) */
|
||||
netif_list = old_netif_list;
|
||||
netif_default = old_netif_default;
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,19 +118,28 @@ tcp_oos_tcplen(struct tcp_pcb* pcb)
|
||||
}
|
||||
|
||||
/* Setup/teardown functions */
|
||||
static struct netif *old_netif_list;
|
||||
static struct netif *old_netif_default;
|
||||
|
||||
static void
|
||||
tcp_oos_setup(void)
|
||||
{
|
||||
old_netif_list = netif_list;
|
||||
old_netif_default = netif_default;
|
||||
netif_list = NULL;
|
||||
netif_default = NULL;
|
||||
tcp_remove_all();
|
||||
}
|
||||
|
||||
static void
|
||||
tcp_oos_teardown(void)
|
||||
{
|
||||
tcp_remove_all();
|
||||
netif_list = NULL;
|
||||
netif_default = NULL;
|
||||
tcp_remove_all();
|
||||
/* restore netif_list for next tests (e.g. loopif) */
|
||||
netif_list = old_netif_list;
|
||||
netif_default = old_netif_default;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user