Extend the packet_test_length() test to properly test odp_packet_buf_len()
Signed-off-by: Bill Fischofer <[email protected]>
---
test/validation/packet/packet.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c
index d59e96c..dc40cfb 100644
--- a/test/validation/packet/packet.c
+++ b/test/validation/packet/packet.c
@@ -277,6 +277,20 @@ void packet_test_length(void)
CU_ASSERT(tailroom >= ODP_CONFIG_PACKET_TAILROOM);
#endif
CU_ASSERT(buf_len >= packet_len + headroom + tailroom);
+
+ pkt = segmented_test_packet;
+ buf_len = odp_packet_buf_len(pkt);
+ headroom = odp_packet_headroom(pkt);
+ tailroom = odp_packet_tailroom(pkt);
+
+ CU_ASSERT(odp_packet_len(pkt) == segmented_packet_len);
+#if ODP_CONFIG_PACKET_HEADROOM != 0 /* Avoid 'always true' warning */
+ CU_ASSERT(headroom >= ODP_CONFIG_PACKET_HEADROOM);
+#endif
+#if ODP_CONFIG_PACKET_TAILROOM != 0 /* Avoid 'always true' warning */
+ CU_ASSERT(tailroom >= ODP_CONFIG_PACKET_TAILROOM);
+#endif
+ CU_ASSERT(buf_len >= packet_len + headroom + tailroom);
}
void packet_test_debug(void)
--
2.5.0
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp