adapt unit tests to additional NULL checks

This commit is contained in:
Simon Goldschmidt
2018-06-12 13:47:13 +02:00
parent 1bf323e12f
commit a26a2e1340
3 changed files with 27 additions and 6 deletions

View File

@@ -16,6 +16,15 @@
static struct netif test_netif6;
static int linkoutput_ctr;
static err_t
dummy_input_function(struct pbuf *p, struct netif *inp)
{
LWIP_UNUSED_ARG(p);
LWIP_UNUSED_ARG(inp);
fail("this netif should have no input");
return ERR_VAL;
}
static err_t
default_netif_linkoutput(struct netif *netif, struct pbuf *p)
{
@@ -42,7 +51,7 @@ default_netif_add(void)
{
struct netif *n;
fail_unless(netif_default == NULL);
n = netif_add_noaddr(&test_netif6, NULL, default_netif_init, NULL);
n = netif_add_noaddr(&test_netif6, NULL, default_netif_init, dummy_input_function);
fail_unless(n == &test_netif6);
netif_set_default(&test_netif6);
}