diff mbox

[API-NEXT,PATCHv3,7/7] validation: classification: correct tests for missing l4 offset

Message ID 1461886398-31382-7-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer April 28, 2016, 11:33 p.m. UTC
To test for a missing L4 offset, comparison must be made to symbol
ODP_PACKET_OFFSET_INVALID rather than 0.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 test/validation/classification/odp_classification_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/test/validation/classification/odp_classification_common.c b/test/validation/classification/odp_classification_common.c
index c1afd00..3f5f5cb 100644
--- a/test/validation/classification/odp_classification_common.c
+++ b/test/validation/classification/odp_classification_common.c
@@ -92,7 +92,7 @@  int cls_pkt_set_seq(odp_packet_t pkt)
 
 	ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
 	offset = odp_packet_l4_offset(pkt);
-	CU_ASSERT_FATAL(offset != 0);
+	CU_ASSERT_FATAL(offset != ODP_PACKET_OFFSET_INVALID);
 
 	if (ip->proto == ODPH_IPPROTO_UDP)
 		status = odp_packet_copy_from_mem(pkt, offset + ODPH_UDPHDR_LEN,
@@ -116,7 +116,7 @@  uint32_t cls_pkt_get_seq(odp_packet_t pkt)
 	ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
 	offset = odp_packet_l4_offset(pkt);
 
-	if (!offset && !ip)
+	if (offset == ODP_PACKET_OFFSET_INVALID || ip == NULL)
 		return TEST_SEQ_INVALID;
 
 	if (ip->proto == ODPH_IPPROTO_UDP)