From patchwork Thu Feb 22 14:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129250 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp633890lja; Thu, 22 Feb 2018 06:06:45 -0800 (PST) X-Google-Smtp-Source: AH8x224Qi5NCWiC9OBKBfqe7b2mcHWUB73nmtdm+SWrizLtRu2rIyv8utiY319EkTcty19uRmO9b X-Received: by 10.200.81.215 with SMTP id d23mr10615920qtn.272.1519308405177; Thu, 22 Feb 2018 06:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519308405; cv=none; d=google.com; s=arc-20160816; b=NKvJXvVq6ESdeKj6NBZwHTML/CRNzWh0IHEchwxhkMsVFD6b6GuhHzP2PKxNObJ15w k8Et92ZCv9WtceX+DAWcLUVXZt/MEdsJs6GvdOcf+dQYwVLB/IyZ5Nkeh3B0y/goZUj9 nl8eThLODO/OSgvvWRiFIWkX3inh9S7TsdGxPddKljbwNsISRwD90IDGigAUZXe0KjrS MZL5ON7jLatTXESd9G+lFb5yr4MaAPZsD6fPQo+futio64wCixMR483NkBIZhoEeQEGM 8qxU6vh/fhq7wQdsuV9YUO6dKw+pj84TrzWzkEi73BKvO1k9Dv3khkH2YT2uiPSFIKeB Ywww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ot+i3OXs4NnUMXO2l3SF2mymy/I9WNuAjlowGtYmdDI=; b=XuK/oA/A/OHD0D985mPcl0ML4CSBwlDe7j5K8WOJJ6tMTruLT4NHs6hw9ZK1m7rpTe G6qy941XhNNFUtxz4mOhny4MALyF0QJ+eB3JjwQAsQPW9feMFSa1d6vytLjG7ufo/Tdg BKn9H/W9qgqkQ7NLmdhvvfP9Eb9vKveLaHUOJAUpZWBMk7gc9S3X+hXiEg7L1EeQ6BXl VpVisbFXkl6rrxU15Ae1h/aaJhP9IUDgAi3YX0JN+vG1Q/tx5kVsDRgS3Kyt+9esZnjM tc0kPmcSZRzmJLvJ0wySoZXPSlrCSE6t7ly3ZEUYMlwp1N++lA5BmDQg2R45wOzLnWbC k8WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id k41si140626qta.252.2018.02.22.06.06.44; Thu, 22 Feb 2018 06:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id CF579617B2; Thu, 22 Feb 2018 14:06:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3B63E6177E; Thu, 22 Feb 2018 14:01:41 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 242E56173A; Thu, 22 Feb 2018 14:01:23 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 9D3556171F for ; Thu, 22 Feb 2018 14:00:23 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 13FDF560306D for ; Thu, 22 Feb 2018 17:00:14 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VYLh01sGDU-0DauEnKh; Thu, 22 Feb 2018 17:00:14 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IAwM2n92hm-0DYWHQOg; Thu, 22 Feb 2018 17:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 17:00:09 +0300 Message-Id: <1519308009-12837-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519308009-12837-1-git-send-email-odpbot@yandex.ru> References: <1519308009-12837-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 497 Subject: [lng-odp] [PATCH API-NEXT v1 4/4] validation: packet: test packet_data_seg_len X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Test the new combined packet data and seg_len function. Signed-off-by: Petri Savolainen --- /** Email created from pull request 497 (psavol:next-packet-data-doc) ** https://github.com/Linaro/odp/pull/497 ** Patch: https://github.com/Linaro/odp/pull/497.patch ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88 ** Merge commit sha: d1c9a3d36dfe9e38ecfe7d4a52bebe13d0c01098 **/ test/validation/api/packet/packet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index f829d0cb1..78a14800c 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -604,7 +604,8 @@ void packet_test_basic_metadata(void) void packet_test_length(void) { odp_packet_t pkt = test_packet; - uint32_t buf_len, headroom, tailroom; + uint32_t buf_len, headroom, tailroom, seg_len; + void *data; odp_pool_capability_t capa; CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); @@ -612,8 +613,13 @@ void packet_test_length(void) buf_len = odp_packet_buf_len(pkt); headroom = odp_packet_headroom(pkt); tailroom = odp_packet_tailroom(pkt); + data = odp_packet_data(pkt); + CU_ASSERT(data != NULL); CU_ASSERT(odp_packet_len(pkt) == packet_len); + CU_ASSERT(odp_packet_seg_len(pkt) <= packet_len); + CU_ASSERT(odp_packet_data_seg_len(pkt, &seg_len) == data); + CU_ASSERT(seg_len == odp_packet_seg_len(pkt)); CU_ASSERT(headroom >= capa.pkt.min_headroom); CU_ASSERT(tailroom >= capa.pkt.min_tailroom);