diff mbox series

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

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

Commit Message

Github ODP bot Sept. 12, 2017, 1 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: fb3f36cec108ce9c55241d9f0e66d4832a552b8a
 ** Merge commit sha: bab9e010b5432ba0f2ff0651313a85a6a1b563c2
 **/
 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 898dac87..c40dab98 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));