Esempio n. 1
0
static void test_ipv6_netif_add__success(void)
{
    ng_ipv6_netif_t *entry;

    ng_ipv6_netif_add(DEFAULT_TEST_NETIF);

    TEST_ASSERT_NOT_NULL((entry = ng_ipv6_netif_get(DEFAULT_TEST_NETIF)));
    TEST_ASSERT_EQUAL_INT(DEFAULT_TEST_NETIF, entry->pid);
}
Esempio n. 2
0
static void test_ipv6_netif_add__despite_free_entry(void)
{
    /* Tests for possible duplicates as described in http://github.com/RIOT-OS/RIOT/issues/2965 */

    ng_ipv6_netif_add(OTHER_TEST_NETIF);
    test_ipv6_netif_add__success(); /* adds DEFAULT_TEST_NETIF as interface */

    /* create space by removing first entry */
    ng_ipv6_netif_remove(OTHER_TEST_NETIF);

    /* add DEFAULT_TEST_NETIF yet again and remove it */
    test_ipv6_netif_add__success();
    ng_ipv6_netif_remove(DEFAULT_TEST_NETIF);

    /* see if there's a duplicate left */
    TEST_ASSERT_NULL(ng_ipv6_netif_get(DEFAULT_TEST_NETIF));
}