From 29036674949882b1e2219b2433dd6bc55f4cdc96 Mon Sep 17 00:00:00 2001
From: Martine Lenders <mlenders@inf.fu-berlin.de>
Date: Mon, 10 Aug 2015 02:04:35 +0200
Subject: [PATCH] tests: adapt unittests for ipv6_hdr module division

---
 Makefile.dep                                  |  18 +--
 sys/include/net/ipv6/hdr.h                    |   1 +
 sys/include/net/ng_ipv6/hdr.h                 |   1 +
 .../link_layer/ng_netdev_eth/ng_netdev_eth.c  |   4 +-
 .../ng_icmpv6/echo/ng_icmpv6_echo.c           |   1 +
 .../ng_ndp/internal/ng_ndp_internal.c         |   8 +-
 .../network_layer/ng_ndp/node/ng_ndp_node.c   |   7 +-
 sys/shell/commands/sc_icmpv6_echo.c           |   2 +-
 tests/unittests/tests-gnrc_ipv6_hdr/Makefile  |   1 +
 .../tests-gnrc_ipv6_hdr/Makefile.include      |   1 +
 .../tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.c | 148 ++++++++++++++++++
 .../tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.h |  37 +++++
 .../unittests/tests-ipv6_hdr/Makefile.include |   1 -
 .../unittests/tests-ipv6_hdr/tests-ipv6_hdr.c |  96 ------------
 14 files changed, 212 insertions(+), 114 deletions(-)
 create mode 100644 tests/unittests/tests-gnrc_ipv6_hdr/Makefile
 create mode 100644 tests/unittests/tests-gnrc_ipv6_hdr/Makefile.include
 create mode 100644 tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.c
 create mode 100644 tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.h

diff --git a/Makefile.dep b/Makefile.dep
index 82d8e112c8..cef86d98a3 100644
--- a/Makefile.dep
+++ b/Makefile.dep
@@ -107,15 +107,6 @@ ifneq (,$(filter ng_icmpv6,$(USEMODULE)))
   USEMODULE += ng_ipv6
 endif
 
-ifneq (,$(filter ng_ipv6_hdr,$(USEMODULE)))
-  USEMODULE += ipv6_hdr
-  USEMODULE += ng_pktbuf
-endif
-
-ifneq (,$(filter ipv6_hdr,$(USEMODULE)))
-  USEMODULE += inet_csum
-endif
-
 ifneq (,$(filter ng_rpl_srh,$(USEMODULE)))
   USEMODULE += ipv6_ext_rh
 endif
@@ -142,6 +133,15 @@ ifneq (,$(filter ng_ipv6,$(USEMODULE)))
   USEMODULE += ng_netbase
 endif
 
+ifneq (,$(filter ng_ipv6_hdr,$(USEMODULE)))
+  USEMODULE += ipv6_hdr
+  USEMODULE += ng_pktbuf
+endif
+
+ifneq (,$(filter ipv6_hdr,$(USEMODULE)))
+  USEMODULE += inet_csum
+endif
+
 ifneq (,$(filter ng_ipv6_nc,$(USEMODULE)))
   USEMODULE += ipv6_addr
 endif
diff --git a/sys/include/net/ipv6/hdr.h b/sys/include/net/ipv6/hdr.h
index f2df288c29..6ef9225b27 100644
--- a/sys/include/net/ipv6/hdr.h
+++ b/sys/include/net/ipv6/hdr.h
@@ -23,6 +23,7 @@
 #include <stdint.h>
 
 #include "byteorder.h"
+#include "net/inet_csum.h"
 #include "net/ipv6/addr.h"
 
 #ifdef __cplusplus
diff --git a/sys/include/net/ng_ipv6/hdr.h b/sys/include/net/ng_ipv6/hdr.h
index 4aa95debdb..f5968a0145 100644
--- a/sys/include/net/ng_ipv6/hdr.h
+++ b/sys/include/net/ng_ipv6/hdr.h
@@ -21,6 +21,7 @@
 
 #include <stdint.h>
 
+#include "net/ipv6/hdr.h"
 #include "net/ng_pkt.h"
 
 #ifdef __cplusplus
diff --git a/sys/net/link_layer/ng_netdev_eth/ng_netdev_eth.c b/sys/net/link_layer/ng_netdev_eth/ng_netdev_eth.c
index 4d729a394b..d0f7b965fe 100644
--- a/sys/net/link_layer/ng_netdev_eth/ng_netdev_eth.c
+++ b/sys/net/link_layer/ng_netdev_eth/ng_netdev_eth.c
@@ -365,8 +365,8 @@ static inline void _addr_set_multicast(uint8_t *dst, ng_pktsnip_t *payload)
             if ((payload != NULL) && (payload->data != NULL)) {
                 ipv6_hdr_t *hdr = payload->data;
                 uint16_t *prefix = (uint16_t *)(&dst[2]);
-                prefix[0] = hdr->dst.u16[6];
-                prefix[1] = hdr->dst.u16[7];
+                prefix[0] = hdr->dst.u16[6].u16;
+                prefix[1] = hdr->dst.u16[7].u16;
             }
             break;
 #endif
diff --git a/sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c b/sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c
index 09daa4ab18..85a5dfed90 100644
--- a/sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c
+++ b/sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c
@@ -17,6 +17,7 @@
 #include "od.h"
 #include "net/ng_icmpv6.h"
 #include "net/ng_icmpv6/echo.h"
+#include "net/ng_ipv6/hdr.h"
 #include "utlist.h"
 
 #define ENABLE_DEBUG    (0)
diff --git a/sys/net/network_layer/ng_ndp/internal/ng_ndp_internal.c b/sys/net/network_layer/ng_ndp/internal/ng_ndp_internal.c
index ca3142e9e5..bb52b177a0 100644
--- a/sys/net/network_layer/ng_ndp/internal/ng_ndp_internal.c
+++ b/sys/net/network_layer/ng_ndp/internal/ng_ndp_internal.c
@@ -213,7 +213,7 @@ void ng_ndp_internal_send_nbr_adv(kernel_pid_t iface, ipv6_addr_t *tgt,
         return;
     }
 
-    ((ng_ipv6_hdr_t *)hdr->data)->hl = 255;
+    ((ipv6_hdr_t *)hdr->data)->hl = 255;
 
     pkt = hdr;
     /* add netif header for send interface specification */
@@ -293,7 +293,7 @@ void ng_ndp_internal_send_nbr_sol(kernel_pid_t iface, ipv6_addr_t *tgt,
         return;
     }
 
-    ((ng_ipv6_hdr_t *)hdr->data)->hl = 255;
+    ((ipv6_hdr_t *)hdr->data)->hl = 255;
 
     pkt = hdr;
     /* add netif header for send interface specification */
@@ -312,7 +312,7 @@ void ng_ndp_internal_send_nbr_sol(kernel_pid_t iface, ipv6_addr_t *tgt,
 }
 
 bool ng_ndp_internal_sl2a_opt_handle(kernel_pid_t iface, ng_pktsnip_t *pkt,
-                                     ng_ipv6_hdr_t *ipv6, uint8_t icmpv6_type,
+                                     ipv6_hdr_t *ipv6, uint8_t icmpv6_type,
                                      ng_ndp_opt_t *sl2a_opt)
 {
     ng_ipv6_nc_t *nc_entry = NULL;
@@ -371,7 +371,7 @@ bool ng_ndp_internal_sl2a_opt_handle(kernel_pid_t iface, ng_pktsnip_t *pkt,
     }
 }
 
-int ng_ndp_internal_tl2a_opt_handle(ng_pktsnip_t *pkt, ng_ipv6_hdr_t *ipv6,
+int ng_ndp_internal_tl2a_opt_handle(ng_pktsnip_t *pkt, ipv6_hdr_t *ipv6,
                                     uint8_t icmpv6_type, ng_ndp_opt_t *tl2a_opt,
                                     uint8_t *l2addr)
 {
diff --git a/sys/net/network_layer/ng_ndp/node/ng_ndp_node.c b/sys/net/network_layer/ng_ndp/node/ng_ndp_node.c
index 1107d36adf..0a99c86b70 100644
--- a/sys/net/network_layer/ng_ndp/node/ng_ndp_node.c
+++ b/sys/net/network_layer/ng_ndp/node/ng_ndp_node.c
@@ -63,7 +63,12 @@ kernel_pid_t ng_ndp_node_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len,
     ipv6_addr_t *next_hop_ip = NULL, *prefix = NULL;
 
 #ifdef MODULE_NG_IPV6_EXT_RH
-    next_hop_ip = ng_ipv6_ext_rh_next_hop(hdr);
+    ipv6_hdr_t *hdr;
+    ng_pktsnip_t *ipv6;
+    LL_SEARCH_SCALAR(pkt, ipv6, type, NG_NETTYPE_IPV6);
+    assert(ipv6);
+    hdr = ipv6->data;
+    next_hop_ip = ipv6_ext_rh_next_hop(hdr);
 #endif
 #ifdef MODULE_FIB
     /* don't look-up link local addresses in FIB */
diff --git a/sys/shell/commands/sc_icmpv6_echo.c b/sys/shell/commands/sc_icmpv6_echo.c
index a777a99132..c5332aa724 100644
--- a/sys/shell/commands/sc_icmpv6_echo.c
+++ b/sys/shell/commands/sc_icmpv6_echo.c
@@ -80,7 +80,7 @@ static inline bool _expected_seq(uint16_t seq)
 int _handle_reply(ng_pktsnip_t *pkt, uint64_t time)
 {
     ng_pktsnip_t *ipv6, *icmpv6;
-    ng_ipv6_hdr_t *ipv6_hdr;
+    ipv6_hdr_t *ipv6_hdr;
     ng_icmpv6_echo_t *icmpv6_hdr;
     uint16_t seq;
 
diff --git a/tests/unittests/tests-gnrc_ipv6_hdr/Makefile b/tests/unittests/tests-gnrc_ipv6_hdr/Makefile
new file mode 100644
index 0000000000..48422e909a
--- /dev/null
+++ b/tests/unittests/tests-gnrc_ipv6_hdr/Makefile
@@ -0,0 +1 @@
+include $(RIOTBASE)/Makefile.base
diff --git a/tests/unittests/tests-gnrc_ipv6_hdr/Makefile.include b/tests/unittests/tests-gnrc_ipv6_hdr/Makefile.include
new file mode 100644
index 0000000000..e8dcdd2cba
--- /dev/null
+++ b/tests/unittests/tests-gnrc_ipv6_hdr/Makefile.include
@@ -0,0 +1 @@
+USEMODULE += ng_ipv6_hdr
diff --git a/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.c b/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.c
new file mode 100644
index 0000000000..5b468103ca
--- /dev/null
+++ b/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2014 Martine Lenders <mlenders@inf.fu-berlin.de>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @{
+ *
+ * @file
+ */
+#include <errno.h>
+#include <stdlib.h>
+
+#include "embUnit.h"
+
+#include "net/ipv6/addr.h"
+#include "net/ipv6/hdr.h"
+#include "net/ng_ipv6/hdr.h"
+#include "net/ng_pktbuf.h"
+
+#include "unittests-constants.h"
+#include "tests-gnrc_ipv6_hdr.h"
+
+#define DEFAULT_TEST_SRC    { { \
+            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \
+            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f \
+        } \
+    }
+#define DEFAULT_TEST_DST    { { \
+            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, \
+            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f \
+        } \
+    }
+
+static void test_gnrc_ipv6_hdr_build__wrong_src_len(void)
+{
+    ipv6_addr_t src = DEFAULT_TEST_SRC;
+    ipv6_addr_t dst = DEFAULT_TEST_DST;
+
+    ng_pktbuf_init();
+    TEST_ASSERT_NULL(ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
+                                       sizeof(ipv6_addr_t) + TEST_UINT8,
+                                       (uint8_t *)&dst,
+                                       sizeof(ipv6_addr_t)));
+    TEST_ASSERT(ng_pktbuf_is_empty());
+}
+
+static void test_gnrc_ipv6_hdr_build__wrong_dst_len(void)
+{
+    ipv6_addr_t src = DEFAULT_TEST_SRC;
+    ipv6_addr_t dst = DEFAULT_TEST_DST;
+
+    ng_pktbuf_init();
+    TEST_ASSERT_NULL(ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
+                                       sizeof(ipv6_addr_t),
+                                       (uint8_t *)&dst,
+                                       sizeof(ipv6_addr_t) + TEST_UINT8));
+    TEST_ASSERT(ng_pktbuf_is_empty());
+}
+
+static void test_gnrc_ipv6_hdr_build__src_NULL(void)
+{
+    ipv6_addr_t dst = DEFAULT_TEST_DST;
+    ng_pktsnip_t *pkt;
+    ipv6_hdr_t *hdr;
+
+    ng_pktbuf_init();
+    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, NULL, 0, (uint8_t *)&dst,
+                                sizeof(ipv6_addr_t))));
+    hdr = pkt->data;
+    TEST_ASSERT_NOT_NULL(hdr);
+    TEST_ASSERT(ipv6_hdr_is(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_tc(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_fl(hdr));
+    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
+    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
+    TEST_ASSERT(ipv6_addr_equal(&dst, &hdr->dst));
+    TEST_ASSERT(!ng_pktbuf_is_empty());
+}
+
+static void test_gnrc_ipv6_hdr_build__dst_NULL(void)
+{
+    ipv6_addr_t src = DEFAULT_TEST_SRC;
+    ng_pktsnip_t *pkt;
+    ipv6_hdr_t *hdr;
+
+    ng_pktbuf_init();
+    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
+                                sizeof(ipv6_addr_t),
+                                NULL, 0)));
+    hdr = pkt->data;
+    TEST_ASSERT_NOT_NULL(hdr);
+    TEST_ASSERT(ipv6_hdr_is(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_tc(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_fl(hdr));
+    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
+    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
+    TEST_ASSERT(ipv6_addr_equal(&src, &hdr->src));
+    TEST_ASSERT(!ng_pktbuf_is_empty());
+}
+
+static void test_gnrc_ipv6_hdr_build__complete(void)
+{
+    ipv6_addr_t src = DEFAULT_TEST_SRC;
+    ipv6_addr_t dst = DEFAULT_TEST_DST;
+    ng_pktsnip_t *pkt;
+    ipv6_hdr_t *hdr;
+
+    ng_pktbuf_init();
+    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
+                                sizeof(ipv6_addr_t),
+                                (uint8_t *)&dst,
+                                sizeof(ipv6_addr_t))));
+    hdr = pkt->data;
+    TEST_ASSERT_NOT_NULL(hdr);
+    TEST_ASSERT(ipv6_hdr_is(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_tc(hdr));
+    TEST_ASSERT_EQUAL_INT(0, ipv6_hdr_get_fl(hdr));
+    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
+    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
+    TEST_ASSERT(ipv6_addr_equal(&src, &hdr->src));
+    TEST_ASSERT(ipv6_addr_equal(&dst, &hdr->dst));
+    TEST_ASSERT(!ng_pktbuf_is_empty());
+}
+
+Test *tests_gnrc_ipv6_hdr_tests(void)
+{
+    EMB_UNIT_TESTFIXTURES(fixtures) {
+        new_TestFixture(test_gnrc_ipv6_hdr_build__wrong_src_len),
+        new_TestFixture(test_gnrc_ipv6_hdr_build__wrong_dst_len),
+        new_TestFixture(test_gnrc_ipv6_hdr_build__src_NULL),
+        new_TestFixture(test_gnrc_ipv6_hdr_build__dst_NULL),
+        new_TestFixture(test_gnrc_ipv6_hdr_build__complete),
+    };
+
+    EMB_UNIT_TESTCALLER(ipv6_hdr_tests, NULL, NULL, fixtures);
+
+    return (Test *)&ipv6_hdr_tests;
+}
+
+void tests_gnrc_ipv6_hdr(void)
+{
+    TESTS_RUN(tests_gnrc_ipv6_hdr_tests());
+}
+/** @} */
diff --git a/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.h b/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.h
new file mode 100644
index 0000000000..a31fda0a61
--- /dev/null
+++ b/tests/unittests/tests-gnrc_ipv6_hdr/tests-gnrc_ipv6_hdr.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 Martin Lenders
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @addtogroup  unittests
+ * @{
+ *
+ * @file
+ * @brief       Unittests for the ``gnrc_ipv6_hdr`` module
+ *
+ * @author      Martine Lenders <mlenders@inf.fu-berlin.de>
+ */
+#ifndef TESTS_GNRC_IPV6_HDR_H_
+#define TESTS_GNRC_IPV6_HDR_H_
+
+#include "embUnit.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief   The entry point of this test suite.
+ */
+void tests_gnrc_ipv6_hdr(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TESTS_GNRC_IPV6_HDR_H_ */
+/** @} */
diff --git a/tests/unittests/tests-ipv6_hdr/Makefile.include b/tests/unittests/tests-ipv6_hdr/Makefile.include
index db096a6bb8..ec9b879943 100644
--- a/tests/unittests/tests-ipv6_hdr/Makefile.include
+++ b/tests/unittests/tests-ipv6_hdr/Makefile.include
@@ -1,2 +1 @@
 USEMODULE += ipv6_hdr
-USEMODULE += ng_ipv6_hdr
diff --git a/tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c b/tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
index ed36234c3d..e264b0fb04 100644
--- a/tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
+++ b/tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
@@ -297,97 +297,6 @@ static void test_ipv6_hdr_inet_csum__initial_sum_0(void)
     TEST_ASSERT_EQUAL_INT(0xab32, res);
 }
 
-static void test_ipv6_hdr_build__wrong_src_len(void)
-{
-    ipv6_addr_t src = DEFAULT_TEST_SRC;
-    ipv6_addr_t dst = DEFAULT_TEST_DST;
-
-    ng_pktbuf_init();
-    TEST_ASSERT_NULL(ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
-                                       sizeof(ipv6_addr_t) + TEST_UINT8,
-                                       (uint8_t *)&dst,
-                                       sizeof(ipv6_addr_t)));
-    TEST_ASSERT(ng_pktbuf_is_empty());
-}
-
-static void test_ipv6_hdr_build__wrong_dst_len(void)
-{
-    ipv6_addr_t src = DEFAULT_TEST_SRC;
-    ipv6_addr_t dst = DEFAULT_TEST_DST;
-
-    ng_pktbuf_init();
-    TEST_ASSERT_NULL(ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
-                                       sizeof(ipv6_addr_t),
-                                       (uint8_t *)&dst,
-                                       sizeof(ipv6_addr_t) + TEST_UINT8));
-    TEST_ASSERT(ng_pktbuf_is_empty());
-}
-
-static void test_ipv6_hdr_build__src_NULL(void)
-{
-    ipv6_addr_t dst = DEFAULT_TEST_DST;
-    ng_pktsnip_t *pkt;
-    ng_ipv6_hdr_t *hdr;
-
-    ng_pktbuf_init();
-    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, NULL, 0, (uint8_t *)&dst,
-                                sizeof(ipv6_addr_t))));
-    hdr = pkt->data;
-    TEST_ASSERT_NOT_NULL(hdr);
-    TEST_ASSERT(ng_ipv6_hdr_is(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_tc(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_fl(hdr));
-    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
-    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
-    TEST_ASSERT(ipv6_addr_equal(&dst, &hdr->dst));
-    TEST_ASSERT(!ng_pktbuf_is_empty());
-}
-
-static void test_ipv6_hdr_build__dst_NULL(void)
-{
-    ipv6_addr_t src = DEFAULT_TEST_SRC;
-    ng_pktsnip_t *pkt;
-    ng_ipv6_hdr_t *hdr;
-
-    ng_pktbuf_init();
-    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
-                                sizeof(ipv6_addr_t),
-                                NULL, 0)));
-    hdr = pkt->data;
-    TEST_ASSERT_NOT_NULL(hdr);
-    TEST_ASSERT(ng_ipv6_hdr_is(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_tc(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_fl(hdr));
-    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
-    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
-    TEST_ASSERT(ipv6_addr_equal(&src, &hdr->src));
-    TEST_ASSERT(!ng_pktbuf_is_empty());
-}
-
-static void test_ipv6_hdr_build__complete(void)
-{
-    ipv6_addr_t src = DEFAULT_TEST_SRC;
-    ipv6_addr_t dst = DEFAULT_TEST_DST;
-    ng_pktsnip_t *pkt;
-    ng_ipv6_hdr_t *hdr;
-
-    ng_pktbuf_init();
-    TEST_ASSERT_NOT_NULL((pkt = ng_ipv6_hdr_build(NULL, (uint8_t *)&src,
-                                sizeof(ipv6_addr_t),
-                                (uint8_t *)&dst,
-                                sizeof(ipv6_addr_t))));
-    hdr = pkt->data;
-    TEST_ASSERT_NOT_NULL(hdr);
-    TEST_ASSERT(ng_ipv6_hdr_is(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_tc(hdr));
-    TEST_ASSERT_EQUAL_INT(0, ng_ipv6_hdr_get_fl(hdr));
-    TEST_ASSERT_EQUAL_INT(PROTNUM_RESERVED, hdr->nh);
-    TEST_ASSERT_EQUAL_INT(0, hdr->hl);
-    TEST_ASSERT(ipv6_addr_equal(&src, &hdr->src));
-    TEST_ASSERT(ipv6_addr_equal(&dst, &hdr->dst));
-    TEST_ASSERT(!ng_pktbuf_is_empty());
-}
-
 Test *tests_ipv6_hdr_tests(void)
 {
     EMB_UNIT_TESTFIXTURES(fixtures) {
@@ -405,11 +314,6 @@ Test *tests_ipv6_hdr_tests(void)
         new_TestFixture(test_ipv6_hdr_get_fl),
         new_TestFixture(test_ipv6_hdr_inet_csum__initial_sum_overflows),
         new_TestFixture(test_ipv6_hdr_inet_csum__initial_sum_0),
-        new_TestFixture(test_ipv6_hdr_build__wrong_src_len),
-        new_TestFixture(test_ipv6_hdr_build__wrong_dst_len),
-        new_TestFixture(test_ipv6_hdr_build__src_NULL),
-        new_TestFixture(test_ipv6_hdr_build__dst_NULL),
-        new_TestFixture(test_ipv6_hdr_build__complete),
     };
 
     EMB_UNIT_TESTCALLER(ipv6_hdr_tests, NULL, NULL, fixtures);
-- 
GitLab