Ejemplo n.º 1
0
static void test_ipv6_netif_remove__not_allocated(void)
{
    test_ipv6_netif_add__success(); /* adds DEFAULT_TEST_NETIF as interface */
    ng_ipv6_netif_remove(OTHER_TEST_NETIF);
    TEST_ASSERT_NULL(ng_ipv6_netif_get(OTHER_TEST_NETIF));
    TEST_ASSERT_NOT_NULL(ng_ipv6_netif_get(DEFAULT_TEST_NETIF));
}
Ejemplo 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));
}