1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 00:49:45 +01:00

tests/unittests: use proper initializers for gnrc_pktsnip_t

This commit is contained in:
Benjamin Valentin 2024-11-15 17:06:47 +01:00
parent 300a936e42
commit cb554fd342
3 changed files with 8 additions and 5 deletions

View File

@ -325,7 +325,10 @@ static void test_pktbuf_mark__pkt_NOT_NULL__size_greater_than_pkt_size(void)
static void test_pktbuf_mark__pkt_NOT_NULL__pkt_data_NULL(void)
{
gnrc_pktsnip_t pkt = { NULL, NULL, sizeof(TEST_STRING16), 1, GNRC_NETTYPE_TEST };
gnrc_pktsnip_t pkt = { .size = sizeof(TEST_STRING16),
.type = GNRC_NETTYPE_TEST,
.users = 1,
};
TEST_ASSERT_NULL(gnrc_pktbuf_mark(&pkt, sizeof(TEST_STRING16) - 1,
GNRC_NETTYPE_TEST));

View File

@ -21,8 +21,8 @@
#include "unittests-constants.h"
#include "tests-pktqueue.h"
#define PKT_INIT_ELEM(len, data, next) \
{ (next), (void *)(data), (len), 1, GNRC_NETTYPE_UNDEF }
#define PKT_INIT_ELEM(len, ptr, nxt) \
{ .next = (nxt), .data = (void *)(ptr), .size = (len), .users = 1, .type = GNRC_NETTYPE_UNDEF }
#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), (void *)(data), (next))
#define PKTQUEUE_INIT_ELEM(pkt) { NULL, pkt }

View File

@ -22,8 +22,8 @@
#include "unittests-constants.h"
#include "tests-priority_pktqueue.h"
#define PKT_INIT_ELEM(len, data, next) \
{ (next), (void *)(data), (len), 1, GNRC_NETTYPE_UNDEF }
#define PKT_INIT_ELEM(len, ptr, nxt) \
{ .next = (nxt), .data = (void *)(ptr), .size = (len), .users = 1, .type = GNRC_NETTYPE_UNDEF }
#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), (void *)(data), (next))
#define PKTQUEUE_INIT_ELEM(pkt) { NULL, pkt }