diff --git a/tests/unittests/tests-gnrc_rpl_srh/tests-gnrc_rpl_srh.c b/tests/unittests/tests-gnrc_rpl_srh/tests-gnrc_rpl_srh.c index 91690a14515d982a30fbabc9ba2a1d45c2e89b98..6122c43937057de3d4c7ef291e0da3c49d3b5e94 100644 --- a/tests/unittests/tests-gnrc_rpl_srh/tests-gnrc_rpl_srh.c +++ b/tests/unittests/tests-gnrc_rpl_srh/tests-gnrc_rpl_srh.c @@ -74,6 +74,7 @@ static void test_rpl_srh_dst_multicast(void) static const ipv6_addr_t mcast = IPV6_MCAST_ADDR; gnrc_rpl_srh_t *srh; uint8_t *vec; + void *err_ptr; int res; _init_hdrs(&srh, &vec, &mcast); @@ -82,8 +83,9 @@ static void test_rpl_srh_dst_multicast(void) memcpy(vec, &a1, sizeof(a1)); memcpy(vec + sizeof(a1), &a2, sizeof(a2)); - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_ERROR); + TEST_ASSERT((&hdr.dst) == err_ptr); } static void test_rpl_srh_route_multicast(void) @@ -93,6 +95,7 @@ static void test_rpl_srh_route_multicast(void) static const ipv6_addr_t dst = IPV6_DST; gnrc_rpl_srh_t *srh; uint8_t *vec; + void *err_ptr; int res; _init_hdrs(&srh, &vec, &dst); @@ -101,8 +104,9 @@ static void test_rpl_srh_route_multicast(void) memcpy(vec, &mcast, sizeof(mcast)); memcpy(vec + sizeof(mcast), &a1, sizeof(a1)); - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_ERROR); + TEST_ASSERT(vec == err_ptr); } static void test_rpl_srh_too_many_seg_left(void) @@ -111,6 +115,7 @@ static void test_rpl_srh_too_many_seg_left(void) static const ipv6_addr_t dst = IPV6_DST; gnrc_rpl_srh_t *srh; uint8_t *vec; + void *err_ptr; int res; _init_hdrs(&srh, &vec, &dst); @@ -118,8 +123,9 @@ static void test_rpl_srh_too_many_seg_left(void) srh->seg_left = SRH_SEG_LEFT; memcpy(vec, &a1, sizeof(a1)); - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_ERROR); + TEST_ASSERT((&srh->seg_left) == err_ptr); } static void test_rpl_srh_nexthop_no_prefix_elided(void) @@ -128,6 +134,7 @@ static void test_rpl_srh_nexthop_no_prefix_elided(void) static const ipv6_addr_t expected1 = IPV6_ADDR1, expected2 = IPV6_ADDR2; gnrc_rpl_srh_t *srh; uint8_t *vec; + void *err_ptr; int res; _init_hdrs(&srh, &vec, &dst); @@ -137,13 +144,13 @@ static void test_rpl_srh_nexthop_no_prefix_elided(void) memcpy(vec + sizeof(a1), &a2, sizeof(a2)); /* first hop */ - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_FORWARDED); TEST_ASSERT_EQUAL_INT(SRH_SEG_LEFT - 1, srh->seg_left); TEST_ASSERT(ipv6_addr_equal(&hdr.dst, &expected1)); /* second hop */ - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_FORWARDED); TEST_ASSERT_EQUAL_INT(SRH_SEG_LEFT - 2, srh->seg_left); TEST_ASSERT(ipv6_addr_equal(&hdr.dst, &expected2)); @@ -155,6 +162,7 @@ static void test_rpl_srh_nexthop_prefix_elided(void) static const ipv6_addr_t expected1 = IPV6_ADDR1, expected2 = IPV6_ADDR2; gnrc_rpl_srh_t *srh; uint8_t *vec; + void *err_ptr; int res; static const uint8_t a1[3] = IPV6_ADDR1_ELIDED; static const uint8_t a2[3] = IPV6_ADDR2_ELIDED; @@ -168,13 +176,13 @@ static void test_rpl_srh_nexthop_prefix_elided(void) memcpy(vec + sizeof(a1), &a2, sizeof(a2)); /* first hop */ - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_FORWARDED); TEST_ASSERT_EQUAL_INT(SRH_SEG_LEFT - 1, srh->seg_left); TEST_ASSERT(ipv6_addr_equal(&hdr.dst, &expected1)); /* second hop */ - res = gnrc_rpl_srh_process(&hdr, srh); + res = gnrc_rpl_srh_process(&hdr, srh, &err_ptr); TEST_ASSERT_EQUAL_INT(res, GNRC_IPV6_EXT_RH_FORWARDED); TEST_ASSERT_EQUAL_INT(SRH_SEG_LEFT - 2, srh->seg_left); TEST_ASSERT(ipv6_addr_equal(&hdr.dst, &expected2));