From patchwork Fri Apr 15 00:25:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65864 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp897134qge; Thu, 14 Apr 2016 17:30:56 -0700 (PDT) X-Received: by 10.50.64.178 with SMTP id p18mr1530767igs.83.1460680256070; Thu, 14 Apr 2016 17:30:56 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o6si2131674igf.32.2016.04.14.17.30.55; Thu, 14 Apr 2016 17:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 74477682B1; Fri, 15 Apr 2016 00:30:55 +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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED 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 E14EE682F0; Fri, 15 Apr 2016 00:26:20 +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 073CF67524; Fri, 15 Apr 2016 00:26:09 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by lists.linaro.org (Postfix) with ESMTPS id 3887167584 for ; Fri, 15 Apr 2016 00:25:40 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id y204so109886606oie.3 for ; Thu, 14 Apr 2016 17:25:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W2wnLMZk+N2BzcTGYql0XS8u0rrKaV7RLZV2EXVoOn8=; b=JznbcLClnOGiw3wvWdRwZex0MbGe/8leDVjgWcH3oM/UtiNT6l1X2NmiBvIugNDBjI bu1NSCSOUiydQsszlvBdJqHnWzFictF+kf+8ME7FfJ3RbWcFrb3+tbIXs3+Jhrxr10FI VCux2wF6IuyQSmOPMtwBx4SvUAVIDxqd72iNo2OPYxpAvzQtC9XwjTJj7lur739UUNRR 7MKLcWE7mV1tdlfYBHG2siV1dkw9K1uQYMfoxXcCwAF0WeNW3HZPLNieht6uUowD7shn 8Hq3tv1EPiq1XXCWOvkfofB502r/fRXAMfglBR1wlaQGMDT1tlxsGtRCqLebJXntPhoJ QsIA== X-Gm-Message-State: AOPr4FVYG0emsw+ikyrL/HTrOSHkWzvb38F31VqACNzqdE8VKjrX3djNzmsIZayj2F3XafPfb4k= X-Received: by 10.202.60.5 with SMTP id j5mr9319713oia.43.1460679939724; Thu, 14 Apr 2016 17:25:39 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id xd3sm2584743oeb.1.2016.04.14.17.25.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Apr 2016 17:25:39 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 14 Apr 2016 19:25:25 -0500 Message-Id: <1460679929-30653-7-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460679929-30653-1-git-send-email-bill.fischofer@linaro.org> References: <1460679929-30653-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv5 06/10] validation: packet: add test for correct odp_packet_buffer_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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Extend the packet_test_length() test to properly test odp_packet_buf_len() Signed-off-by: Bill Fischofer Reviewed-by: Bala Manoharan --- test/validation/packet/packet.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index d59e96c..dc40cfb 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -277,6 +277,20 @@ void packet_test_length(void) CU_ASSERT(tailroom >= ODP_CONFIG_PACKET_TAILROOM); #endif CU_ASSERT(buf_len >= packet_len + headroom + tailroom); + + pkt = segmented_test_packet; + buf_len = odp_packet_buf_len(pkt); + headroom = odp_packet_headroom(pkt); + tailroom = odp_packet_tailroom(pkt); + + CU_ASSERT(odp_packet_len(pkt) == segmented_packet_len); +#if ODP_CONFIG_PACKET_HEADROOM != 0 /* Avoid 'always true' warning */ + CU_ASSERT(headroom >= ODP_CONFIG_PACKET_HEADROOM); +#endif +#if ODP_CONFIG_PACKET_TAILROOM != 0 /* Avoid 'always true' warning */ + CU_ASSERT(tailroom >= ODP_CONFIG_PACKET_TAILROOM); +#endif + CU_ASSERT(buf_len >= packet_len + headroom + tailroom); } void packet_test_debug(void)