From 211cad1ea39e64d04947a68b348eefbc421dea79 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 25 Nov 2014 18:50:12 +0100 Subject: [PATCH 1/2] pktqueue: fix alignment order Alignment order of `pktqueue_node_t` does not align with `priority_queue_node_t` --- sys/net/include/pktqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/include/pktqueue.h b/sys/net/include/pktqueue.h index 6f00f7332d..d74ea0913a 100644 --- a/sys/net/include/pktqueue.h +++ b/sys/net/include/pktqueue.h @@ -37,8 +37,8 @@ extern "C" { */ typedef struct pktqueue_node_t { struct pktqueue_node_t *next; /**< next node in queue */ - void *data; /**< pointer to the data */ uint32_t priority; /**< priority of the node */ + void *data; /**< pointer to the data */ } pktqueue_node_t; /** From 21adda937007cfdae7a3a3fe7a1d4f67e20954cb Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 25 Nov 2014 21:52:28 +0100 Subject: [PATCH 2/2] [SQUASH ME] pktqueue: fix unittests --- tests/unittests/tests-pktqueue/tests-pktqueue.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unittests/tests-pktqueue/tests-pktqueue.c b/tests/unittests/tests-pktqueue/tests-pktqueue.c index ebb9d2f3ac..19a717631c 100644 --- a/tests/unittests/tests-pktqueue/tests-pktqueue.c +++ b/tests/unittests/tests-pktqueue/tests-pktqueue.c @@ -93,12 +93,12 @@ static void test_pktqueue_add_two_equal(void) pktqueue_add(root, elem1); pktqueue_add(root, elem2); - TEST_ASSERT(root->first == elem2); - TEST_ASSERT(((void *)4356) == root->first->data); + TEST_ASSERT(root->first == elem1); + TEST_ASSERT(((void *)27088) == root->first->data); TEST_ASSERT_EQUAL_INT(14202, root->first->priority); - TEST_ASSERT(root->first->next == elem1); - TEST_ASSERT(((void *)27088) == root->first->next->data); + TEST_ASSERT(root->first->next == elem2); + TEST_ASSERT(((void *)4356) == root->first->next->data); TEST_ASSERT_EQUAL_INT(14202, root->first->next->priority); TEST_ASSERT_NULL(root->first->next->next);