diff mbox

[PATCHv3,4/7] validation: packet: add unit tests for strong type display functions

Message ID 1425855170-4191-4-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit 775fa3d3fa46137faf758e50665e2ccf1f61e88c
Headers show

Commit Message

Bill Fischofer March 8, 2015, 10:52 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/odp_packet.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/test/validation/odp_packet.c b/test/validation/odp_packet.c
index 10a38ba..8f764bf 100644
--- a/test/validation/odp_packet.c
+++ b/test/validation/odp_packet.c
@@ -75,6 +75,8 @@  static void packet_alloc_free(void)
 	CU_ASSERT(odp_packet_len(packet) == packet_len);
 	CU_ASSERT(odp_event_type(odp_packet_to_event(packet)) ==
 			ODP_EVENT_PACKET);
+	CU_ASSERT(odp_packet_to_u64(packet) !=
+		  odp_packet_to_u64(ODP_PACKET_INVALID));
 
 	/* Pool should have only one packet */
 	CU_ASSERT_FATAL(odp_packet_alloc(pool, packet_len)
@@ -387,6 +389,8 @@  static void packet_segments(void)
 		CU_ASSERT(seg_data != NULL);
 		CU_ASSERT(seg_buf_addr != NULL);
 		CU_ASSERT(seg_data >= seg_buf_addr);
+		CU_ASSERT(odp_packet_seg_to_u64(seg) !=
+			  odp_packet_seg_to_u64(ODP_PACKET_SEG_INVALID));
 
 		buf_len += seg_buf_len;
 		data_len += seg_data_len;