diff mbox series

[v1,3/11] validation: packet: unshared len with static reference

Message ID 1504879212-3689-4-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/11] linux-gen: packet: roll back to copy based references | expand

Commit Message

Github ODP bot Sept. 8, 2017, 2 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>

---
/** Email created from pull request 170 (psavol:master-packet-ref-rework)
 ** https://github.com/Linaro/odp/pull/170
 ** Patch: https://github.com/Linaro/odp/pull/170.patch
 ** Base sha: 360c1d34b52a2356619b9290811862b9de41de00
 ** Merge commit sha: e19cce86ab00ccd959d2c3c82c0786ec6da19ba7
 **/
 test/common_plat/validation/api/packet/packet.c | 8 ++++++++
 1 file changed, 8 insertions(+)
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..c40dab985 100644
--- a/test/common_plat/validation/api/packet/packet.c
+++ b/test/common_plat/validation/api/packet/packet.c
@@ -2226,6 +2226,14 @@  void packet_test_ref(void)
 	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));