diff mbox series

[API-NEXT,v1,10/19] validation: packet: unshared len with static reference

Message ID 1505422809-5632-11-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/19] travis: fix powerpc test name | expand

Commit Message

Github ODP bot Sept. 14, 2017, 9 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


When static references are used all data is shared, and thus
unshared length is zero. When there's no references, all data
is unique to the packet (unshared len == len).

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 179 (muvarov:api-next)
 ** https://github.com/Linaro/odp/pull/179
 ** Patch: https://github.com/Linaro/odp/pull/179.patch
 ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1
 ** Merge commit sha: ada61f5ba5f940d03a95893940c21028d4c75d19
 **/
 test/common_plat/validation/api/packet/packet.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c
index 898dac878..f291b6ee2 100644
--- a/test/common_plat/validation/api/packet/packet.c
+++ b/test/common_plat/validation/api/packet/packet.c
@@ -2224,8 +2224,14 @@  void packet_test_ref(void)
 	CU_ASSERT(ref_pkt[0] != ODP_PACKET_INVALID);
 
 	if (odp_packet_has_ref(base_pkt) == 1) {
-		/* CU_ASSERT needs braces */
 		CU_ASSERT(odp_packet_has_ref(ref_pkt[0]) == 1);
+		CU_ASSERT(odp_packet_unshared_len(base_pkt) == 0);
+		CU_ASSERT(odp_packet_unshared_len(ref_pkt[0]) == 0);
+	} else {
+		CU_ASSERT(odp_packet_unshared_len(base_pkt) ==
+			  odp_packet_len(base_pkt));
+		CU_ASSERT(odp_packet_unshared_len(ref_pkt[0]) ==
+			  odp_packet_len(ref_pkt[0]));
 	}
 
 	CU_ASSERT(odp_packet_len(ref_pkt[0]) == odp_packet_len(base_pkt));