1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

tests/gnrc_sixlowpan_frag_minfwd: fix compilation with NDEBUG

This commit is contained in:
Gunar Schorcht 2021-12-10 10:51:03 +01:00
parent ab7dcfdfd2
commit 5733fd7b20

View File

@ -22,6 +22,7 @@
#include "net/gnrc/netif/internal.h"
#include "net/netdev_test.h"
#include "sched.h"
#include "test_utils/expect.h"
#include "thread.h"
#define _MSG_QUEUE_SIZE (2)
@ -35,7 +36,7 @@ static gnrc_netif_t _netif;
void _common_set_up(void)
{
assert(_mock_netif != NULL);
expect(_mock_netif != NULL);
gnrc_ipv6_nib_init();
gnrc_netif_acquire(_mock_netif);
gnrc_ipv6_nib_init_iface(_mock_netif);
@ -45,14 +46,14 @@ void _common_set_up(void)
int _get_device_type(netdev_t *dev, void *value, size_t max_len)
{
(void)dev;
assert(max_len == sizeof(uint16_t));
expect(max_len == sizeof(uint16_t));
*((uint16_t *)value) = NETDEV_TYPE_IEEE802154;
return sizeof(uint16_t);
}
static int _get_netdev_proto(netdev_t *netdev, void *value, size_t max_len)
{
assert(max_len == sizeof(gnrc_nettype_t));
expect(max_len == sizeof(gnrc_nettype_t));
(void)netdev;
*((gnrc_nettype_t *)value) = GNRC_NETTYPE_SIXLOWPAN;
@ -62,7 +63,7 @@ static int _get_netdev_proto(netdev_t *netdev, void *value, size_t max_len)
int _get_max_pdu_size(netdev_t *dev, void *value, size_t max_len)
{
(void)dev;
assert(max_len == sizeof(uint16_t));
expect(max_len == sizeof(uint16_t));
*((uint16_t *)value) = 102U;
return sizeof(uint16_t);
}
@ -70,7 +71,7 @@ int _get_max_pdu_size(netdev_t *dev, void *value, size_t max_len)
int _get_src_len(netdev_t *dev, void *value, size_t max_len)
{
(void)dev;
assert(max_len == sizeof(uint16_t));
expect(max_len == sizeof(uint16_t));
*((uint16_t *)value) = IEEE802154_LONG_ADDRESS_LEN;
return sizeof(uint16_t);
}
@ -81,7 +82,7 @@ int _get_address_long(netdev_t *dev, void *value, size_t max_len)
_LL4, _LL5, _LL6, _LL7 };
(void)dev;
assert(max_len >= sizeof(addr));
expect(max_len >= sizeof(addr));
memcpy(value, addr, sizeof(addr));
return sizeof(addr);
}
@ -89,7 +90,7 @@ int _get_address_long(netdev_t *dev, void *value, size_t max_len)
int _get_proto(netdev_t *dev, void *value, size_t max_len)
{
(void)dev;
assert(max_len == sizeof(gnrc_nettype_t));
expect(max_len == sizeof(gnrc_nettype_t));
*((gnrc_nettype_t *)value) = GNRC_NETTYPE_SIXLOWPAN;
return sizeof(gnrc_nettype_t);
}
@ -116,7 +117,7 @@ void _tests_init(void)
&_netif, _mock_netif_stack, THREAD_STACKSIZE_DEFAULT,
GNRC_NETIF_PRIO, "mockup_wpan", &_mock_netdev.netdev.netdev
);
assert(res == 0);
expect(res == 0);
_mock_netif = &_netif;
}