Skip to content

Commit

Permalink
tests: port gnrc_ipv6_nib unittests to gnrc_netif2
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Oct 10, 2017
1 parent 2787e51 commit c906f98
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
29 changes: 0 additions & 29 deletions tests/unittests/tests-gnrc_ipv6_nib/tests-gnrc_ipv6_nib-internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,33 +1910,6 @@ static void test_nib_abr_iter__three_elem_middle_removed(void)
}
#endif

/*
* Creates GNRC_NETIF_NUMOF interfaces and then tries to add another.
* Expected result: should return NULL
*/
static void test_nib_iface_get__no_space_left(void)
{
unsigned iface = 1;

for (int i = 0; i < GNRC_NETIF_NUMOF; i++) {
TEST_ASSERT_NOT_NULL(_nib_iface_get(iface++));
}
TEST_ASSERT_NULL(_nib_iface_get(iface));
}

/*
* Creates an interface and then gets the same interface.
* Expected result: interface pointers should equal
*/
static void test_nib_iface_get__success(void)
{
_nib_iface_t *ni1, *ni2;

TEST_ASSERT_NOT_NULL((ni1 = _nib_iface_get(IFACE)));
TEST_ASSERT_NOT_NULL((ni2 = _nib_iface_get(IFACE)));
TEST_ASSERT(ni1 == ni2);
}

Test *tests_gnrc_ipv6_nib_internal_tests(void)
{
EMB_UNIT_TESTFIXTURES(fixtures) {
Expand Down Expand Up @@ -2035,8 +2008,6 @@ Test *tests_gnrc_ipv6_nib_internal_tests(void)
new_TestFixture(test_nib_abr_iter__three_elem),
new_TestFixture(test_nib_abr_iter__three_elem_middle_removed),
#endif
new_TestFixture(test_nib_iface_get__no_space_left),
new_TestFixture(test_nib_iface_get__success),
};

EMB_UNIT_TESTCALLER(tests, set_up, NULL,
Expand Down
12 changes: 0 additions & 12 deletions tests/unittests/tests-gnrc_ipv6_nib/tests-gnrc_ipv6_nib-nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,12 @@ static void test_nib_nc_mark_reachable__success(void)
{
void *iter_state = NULL;
_nib_onl_entry_t *node;
#if GNRC_IPV6_NIB_CONF_ARSM
evtimer_msg_event_t *event;
#endif
_nib_iface_t *iface;
static const ipv6_addr_t addr = { .u64 = { { .u8 = GLOBAL_PREFIX },
{ .u64 = TEST_UINT64 } } };
gnrc_ipv6_nib_nc_t nce;

TEST_ASSERT_NOT_NULL((node = _nib_nc_add(&addr, IFACE,
GNRC_IPV6_NIB_NC_INFO_NUD_STATE_UNREACHABLE)));
/* set an "infinite" reachability time */
iface = _nib_iface_get(_nib_onl_get_if(node));
iface->reach_time = UINT32_MAX;

/* check pre-state */
TEST_ASSERT(gnrc_ipv6_nib_nc_iter(0, &iter_state, &nce));
Expand All @@ -306,11 +299,6 @@ static void test_nib_nc_mark_reachable__success(void)
/* check if entry is reachable */
TEST_ASSERT_EQUAL_INT(GNRC_IPV6_NIB_NC_INFO_NUD_STATE_REACHABLE,
gnrc_ipv6_nib_nc_get_nud_state(&nce));
/* check if there now is an event for reachability timeout of node */
TEST_ASSERT_NOT_NULL((event = (evtimer_msg_event_t *)_nib_evtimer.events));
TEST_ASSERT_EQUAL_INT(GNRC_IPV6_NIB_REACH_TIMEOUT, event->msg.type);
TEST_ASSERT_MESSAGE(node == event->msg.content.ptr,
"event's context is not node");
#endif
/* check if still the only entry */
TEST_ASSERT(!gnrc_ipv6_nib_nc_iter(0, &iter_state, &nce));
Expand Down

0 comments on commit c906f98

Please sign in to comment.