From patchwork Wed Apr 13 21:06:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65761 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp237561qge; Wed, 13 Apr 2016 14:12:10 -0700 (PDT) X-Received: by 10.140.221.9 with SMTP id r9mr14745226qhb.77.1460581911602; Wed, 13 Apr 2016 14:11:51 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f132si710352qkb.7.2016.04.13.14.11.51; Wed, 13 Apr 2016 14:11:51 -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 25ECD667D3; Wed, 13 Apr 2016 21:11:51 +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 30F69684C5; Wed, 13 Apr 2016 21:07:28 +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 638B6667D2; Wed, 13 Apr 2016 21:06:57 +0000 (UTC) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) by lists.linaro.org (Postfix) with ESMTPS id 13AE6667BF for ; Wed, 13 Apr 2016 21:06:44 +0000 (UTC) Received: by mail-oi0-f48.google.com with SMTP id s79so76716652oie.1 for ; Wed, 13 Apr 2016 14:06:44 -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=oSJld0dEUABYDm7mf1aAUxOn00l7SYVTRlRKselyrnI=; b=isFxwn4mkeIEYaWovkeAZ2pRKqPtle3ErZvYSjjO8/R++x9G/siYQ8SPG2tWimlLUe /BNPexmKahfsLTCQH4SkCo4qPQG/IOl9x5YV1dmN/Fyu7/EuYEO1f862RcYmxO37PcGn hkCDoPA0i5ngUpb83bI6uCEdX0xUtAtIR+SCO1Hfb8Wp2qKhbYu2KUL4UfiI9vD1Xb7e KvNVjsqUQvGm8NckwGzfmPEA5XUKP7ADILSBw69RByjwcbxWML8gimE90s8PxGUXI7/U 9Om0DdlukeU7W38Py0W8shbttFa8G0ELs+jDHjQzoFo+eNESbFb+joJ2IezwXD8O8RpL zoRA== X-Gm-Message-State: AOPr4FWKNBmGH552JLLKwye7FSles5UUSIwMXLpDmlt1vgd00hvEHts9DDU/gcX6zDPJoSq6gsE= X-Received: by 10.157.7.167 with SMTP id 36mr5344126oto.84.1460581603656; Wed, 13 Apr 2016 14:06:43 -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 fg6sm12324046obc.9.2016.04.13.14.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Apr 2016 14:06:43 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 13 Apr 2016 16:06:31 -0500 Message-Id: <1460581595-2366-7-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460581595-2366-1-git-send-email-bill.fischofer@linaro.org> References: <1460581595-2366-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 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 --- 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)