From patchwork Thu Apr 28 23:33:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 66934 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp489552qge; Thu, 28 Apr 2016 16:37:43 -0700 (PDT) X-Received: by 10.50.58.136 with SMTP id r8mr606018igq.75.1461886663710; Thu, 28 Apr 2016 16:37:43 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p18si658118igs.50.2016.04.28.16.37.43; Thu, 28 Apr 2016 16:37:43 -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 36F14615C4; Thu, 28 Apr 2016 23:37:43 +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 0883D615DB; Thu, 28 Apr 2016 23:34:21 +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 6F1DD615C3; Thu, 28 Apr 2016 23:34:15 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by lists.linaro.org (Postfix) with ESMTPS id C2669615CE for ; Thu, 28 Apr 2016 23:33:27 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id k142so101528518oib.1 for ; Thu, 28 Apr 2016 16:33:27 -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=SZThrdQCMmYQj4yeFNBt7vEfMXSdUvOXWKhTFxnmeo8=; b=Kv+T50eDDvQ/GhEN1n921gQkSj/2YpAZVFqBrE1IkKu+u/9WSNFP0SH28C5oL9X2vW rWsOaYz+v2uA8Z9YatGZkWZNHI15QB8hdULza2n2Z63/1QC3BmO4HCI7PkWNrbhkneYe vdsUDJeWLNWCKA1044A0Swg/E3oExYFRrRAQfdPBwPiniD94Y/5K3t1k6VWYG0FstIAW s/oJpaWEYuKmVP6EvDUBBuQFNUXm2a/G6CZZoTntceBMGjT9D3Fzk+vJadBwDneXAY9m S4EPzqG1U9MqAN/UF1MQGJho/XPvcf3SFigwEdQsSzEnaq+o2iIBIUU1a8EYJa3YU02D haFg== X-Gm-Message-State: AOPr4FV8ttYguz5Otvq+vRCIoYir6nH/HgF2TBSBekxRSQhL3mGiJDmZlVM/NamyVheaR6I75Ic= X-Received: by 10.202.64.132 with SMTP id n126mr7265479oia.80.1461886407339; Thu, 28 Apr 2016 16:33:27 -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 x6sm3546466oek.14.2016.04.28.16.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Apr 2016 16:33:26 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 28 Apr 2016 18:33:18 -0500 Message-Id: <1461886398-31382-7-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461886398-31382-1-git-send-email-bill.fischofer@linaro.org> References: <1461886398-31382-1-git-send-email-bill.fischofer@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [API-NEXT PATCHv3 7/7] validation: classification: correct tests for missing l4 offset 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" To test for a missing L4 offset, comparison must be made to symbol ODP_PACKET_OFFSET_INVALID rather than 0. Signed-off-by: Bill Fischofer --- test/validation/classification/odp_classification_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validation/classification/odp_classification_common.c b/test/validation/classification/odp_classification_common.c index c1afd00..3f5f5cb 100644 --- a/test/validation/classification/odp_classification_common.c +++ b/test/validation/classification/odp_classification_common.c @@ -92,7 +92,7 @@ int cls_pkt_set_seq(odp_packet_t pkt) ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); offset = odp_packet_l4_offset(pkt); - CU_ASSERT_FATAL(offset != 0); + CU_ASSERT_FATAL(offset != ODP_PACKET_OFFSET_INVALID); if (ip->proto == ODPH_IPPROTO_UDP) status = odp_packet_copy_from_mem(pkt, offset + ODPH_UDPHDR_LEN, @@ -116,7 +116,7 @@ uint32_t cls_pkt_get_seq(odp_packet_t pkt) ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); offset = odp_packet_l4_offset(pkt); - if (!offset && !ip) + if (offset == ODP_PACKET_OFFSET_INVALID || ip == NULL) return TEST_SEQ_INVALID; if (ip->proto == ODPH_IPPROTO_UDP)