Tailroom test did not call odp_packet_extend_tail() since it pushed
tail too few bytes. Corrected the test to extend the tail by 100
bytes.

Concat test did pass the same packet as src and dst packets. There's
no valid use case to concatenate a packet into itself (forms
a loop). Corrected the test to concatenate two copies of the same
packet.

Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
---
 test/common_plat/validation/api/packet/packet.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/test/common_plat/validation/api/packet/packet.c 
b/test/common_plat/validation/api/packet/packet.c
index 454c73f..8b31872 100644
--- a/test/common_plat/validation/api/packet/packet.c
+++ b/test/common_plat/validation/api/packet/packet.c
@@ -642,9 +642,10 @@ void packet_test_tailroom(void)
        _verify_tailroom_shift(&pkt, 0);
 
        if (segmentation_supported) {
-               _verify_tailroom_shift(&pkt, pull_val);
+               push_val = room + 100;
+               _verify_tailroom_shift(&pkt, push_val);
                _verify_tailroom_shift(&pkt, 0);
-               _verify_tailroom_shift(&pkt, -pull_val);
+               _verify_tailroom_shift(&pkt, -push_val);
        }
 
        odp_packet_free(pkt);
@@ -1157,12 +1158,18 @@ void packet_test_concatsplit(void)
        odp_packet_t pkt, pkt2;
        uint32_t pkt_len;
        odp_packet_t splits[4];
+       odp_pool_t pool;
 
-       pkt = odp_packet_copy(test_packet, odp_packet_pool(test_packet));
+       pool = odp_packet_pool(test_packet);
+       pkt  = odp_packet_copy(test_packet, pool);
+       pkt2 = odp_packet_copy(test_packet, pool);
        pkt_len = odp_packet_len(test_packet);
        CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
+       CU_ASSERT_FATAL(pkt2 != ODP_PACKET_INVALID);
+       CU_ASSERT(pkt_len == odp_packet_len(pkt));
+       CU_ASSERT(pkt_len == odp_packet_len(pkt2));
 
-       CU_ASSERT(odp_packet_concat(&pkt, pkt) == 0);
+       CU_ASSERT(odp_packet_concat(&pkt, pkt2) == 0);
        CU_ASSERT(odp_packet_len(pkt) == pkt_len * 2);
        _packet_compare_offset(pkt, 0, pkt, pkt_len, pkt_len);
 
-- 
2.8.1

Reply via email to