From ccd4b5a2bffdb7a8ed6edc1619c66b74a4136e28 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 14 Apr 2015 11:17:11 +0200 Subject: [PATCH] unittests: adapt unittests for ipv6_addr_init_prefix() change --- .../unittests/tests-ipv6_addr/tests-ipv6_addr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/unittests/tests-ipv6_addr/tests-ipv6_addr.c b/tests/unittests/tests-ipv6_addr/tests-ipv6_addr.c index e7b86f4336..1aabb4afc4 100644 --- a/tests/unittests/tests-ipv6_addr/tests-ipv6_addr.c +++ b/tests/unittests/tests-ipv6_addr/tests-ipv6_addr.c @@ -403,13 +403,23 @@ static void test_ipv6_addr_match_prefix_same_pointer(void) static void test_ipv6_addr_init_prefix(void) { - ng_ipv6_addr_t a, b = { { + ng_ipv6_addr_t a = { { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f + } + }; + ng_ipv6_addr_t b = { { 0x00, 0x01, 0x02, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; + ng_ipv6_addr_t c = { { + 0xff, 0xfe, 0xfd, 0xfd, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f + } + }; - ng_ipv6_addr_init_prefix(&a, &b, 31); - TEST_ASSERT_EQUAL_INT(true, ng_ipv6_addr_equal(&a, &b)); + ng_ipv6_addr_init_prefix(&c, &b, 31); + TEST_ASSERT_EQUAL_INT(true, ng_ipv6_addr_equal(&a, &c)); } static void test_ipv6_addr_set_unspecified(void)