Skip to content

Commit

Permalink
unittests: nc: test reachability of unmanaged entries
Browse files Browse the repository at this point in the history
  • Loading branch information
cgundogan committed Jan 30, 2016
1 parent 4fb3ff8 commit 9cba6e8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,18 @@ static void test_ipv6_nc_is_reachable__reachable(void)
TEST_ASSERT(gnrc_ipv6_nc_is_reachable(entry));
}

static void test_ipv6_nc_is_reachable__unmanaged(void)
{
ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR;
gnrc_ipv6_nc_t *entry = NULL;

test_ipv6_nc_add__success(); /* adds DEFAULT_TEST_IPV6_ADDR to DEFAULT_TEST_NETIF */

TEST_ASSERT_NOT_NULL((entry = gnrc_ipv6_nc_get(DEFAULT_TEST_NETIF, &addr)));
entry->flags = (GNRC_IPV6_NC_STATE_UNMANAGED << GNRC_IPV6_NC_STATE_POS);
TEST_ASSERT(gnrc_ipv6_nc_is_reachable(entry));
}

static void test_ipv6_nc_still_reachable__incomplete(void)
{
ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR;
Expand Down Expand Up @@ -449,6 +461,7 @@ Test *tests_ipv6_nc_tests(void)
new_TestFixture(test_ipv6_nc_get_next_router__second_entry),
new_TestFixture(test_ipv6_nc_is_reachable__incomplete),
new_TestFixture(test_ipv6_nc_is_reachable__reachable),
new_TestFixture(test_ipv6_nc_is_reachable__unmanaged),
new_TestFixture(test_ipv6_nc_still_reachable__incomplete),
new_TestFixture(test_ipv6_nc_still_reachable__success),
new_TestFixture(test_ipv6_nc_get_l2_addr__NULL_entry),
Expand Down

0 comments on commit 9cba6e8

Please sign in to comment.