diff mbox

[2/2] validation: packets: verify offsets can be set to invalid

Message ID 1422020496-4484-2-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Jan. 23, 2015, 1:41 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/buffer/odp_packet_test.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/test/validation/buffer/odp_packet_test.c b/test/validation/buffer/odp_packet_test.c
index d073b49..ceb4ea9 100644
--- a/test/validation/buffer/odp_packet_test.c
+++ b/test/validation/buffer/odp_packet_test.c
@@ -203,6 +203,14 @@  static void packet_layer_offsets(void)
 	CU_ASSERT(l2_addr != l3_addr);
 	CU_ASSERT(l2_addr != l4_addr);
 	CU_ASSERT(l3_addr != l4_addr);
+
+	/* Set offsets back to invalid */
+	odp_packet_l2_offset_set(pkt, ODP_PACKET_OFFSET_INVALID);
+	CU_ASSERT(odp_packet_l2_offset(pkt) == ODP_PACKET_OFFSET_INVALID);
+	odp_packet_l3_offset_set(pkt, ODP_PACKET_OFFSET_INVALID);
+	CU_ASSERT(odp_packet_l3_offset(pkt) == ODP_PACKET_OFFSET_INVALID);
+	odp_packet_l4_offset_set(pkt, ODP_PACKET_OFFSET_INVALID);
+	CU_ASSERT(odp_packet_l4_offset(pkt) == ODP_PACKET_OFFSET_INVALID);
 }
 
 static void _verify_headroom_shift(odp_packet_t packet,