From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B6AC45ACE for ; Tue, 20 Jan 2015 19:41:40 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 20 Jan 2015 10:38:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,435,1418112000"; d="scan'208";a="664782653" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Jan 2015 10:41:20 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t0KIfKG4029477; Tue, 20 Jan 2015 18:41:20 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t0KIfKkP018798; Tue, 20 Jan 2015 18:41:20 GMT Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t0KIfKQq018794; Tue, 20 Jan 2015 18:41:20 GMT From: Konstantin Ananyev To: dev@dpdk.org Date: Tue, 20 Jan 2015 18:40:51 +0000 Message-Id: <1421779267-18492-3-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1421779267-18492-1-git-send-email-konstantin.ananyev@intel.com> References: <1421779267-18492-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH v3 02/18] app/test: few small fixes fot test_acl.c X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2015 18:41:42 -0000 Make sure that test_acl would not ignore error conditions. Run classify() with all possible values. Signed-off-by: Konstantin Ananyev --- app/test/test_acl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 356d620..7119ad3 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -111,7 +111,7 @@ test_classify_run(struct rte_acl_ctx *acx) * these will run quite a few times, it's necessary to test code paths * from num=0 to num>8 */ - for (count = 0; count < RTE_DIM(acl_test_data); count++) { + for (count = 0; count <= RTE_DIM(acl_test_data); count++) { ret = rte_acl_classify(acx, data, results, count, RTE_ACL_MAX_CATEGORIES); if (ret != 0) { @@ -128,6 +128,7 @@ test_classify_run(struct rte_acl_ctx *acx) "(expected %"PRIu32" got %"PRIu32")!\n", __LINE__, i, acl_test_data[i].allow, result); + ret = -EINVAL; goto err; } } @@ -140,6 +141,7 @@ test_classify_run(struct rte_acl_ctx *acx) "(expected %"PRIu32" got %"PRIu32")!\n", __LINE__, i, acl_test_data[i].deny, result); + ret = -EINVAL; goto err; } } @@ -150,7 +152,7 @@ test_classify_run(struct rte_acl_ctx *acx) RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES, RTE_ACL_CLASSIFY_SCALAR); if (ret != 0) { - printf("Line %i: SSE classify failed!\n", __LINE__); + printf("Line %i: scalar classify failed!\n", __LINE__); goto err; } @@ -162,6 +164,7 @@ test_classify_run(struct rte_acl_ctx *acx) "(expected %"PRIu32" got %"PRIu32")!\n", __LINE__, i, acl_test_data[i].allow, result); + ret = -EINVAL; goto err; } } @@ -174,6 +177,7 @@ test_classify_run(struct rte_acl_ctx *acx) "(expected %"PRIu32" got %"PRIu32")!\n", __LINE__, i, acl_test_data[i].deny, result); + ret = -EINVAL; goto err; } } -- 1.8.5.3