From patchwork Tue Apr 15 10:46:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 28407 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3DBFD2036D for ; Tue, 15 Apr 2014 10:47:22 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf30873790qcx.5 for ; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=QieiIqu2AE66Rgw//BgDWIv5h1+HJOa50b/05S+sxqA=; b=kxhww4j46AUmU+WPBT9xgIAkrp7jroL0sUk2MoasOmRjLdws7naO9bAtB6JllA+wFV dlCpXL7dROBjM7/3UhIe0uxEEY8jCswFi7MkvA26hUxHOFbuj2ctZJJP3J5wZsUe0lgi 9slQC/fNEA8L+XyYGRyX/SfrOGiucmXsMmfYm6hYVjxtQjeuo+d4jUjYQLjKg3du1ss2 rJ7tXS9Z+2pLtJd3VS+Hom5QIH26RyiEzIigj6e0OSKIesm1Jz0TA/8pB6pfd1GorI4n p1eDlG3+KtRyg9Jdp2ea89LHDqtWTXiv7xZtiSyJZzzE3gSA3FXuocQNzOMFWOO4xYs2 E2NQ== X-Gm-Message-State: ALoCoQm+mNa6GFuIyxb/etysPfKCQQCn34Te7HLq8hTMD7g1yMNUWZcI+8HwV5amnegT+Gxkhuqt X-Received: by 10.236.117.79 with SMTP id i55mr380474yhh.16.1397558841959; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.70 with SMTP id 64ls96818qgy.48.gmail; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-Received: by 10.58.49.10 with SMTP id q10mr748942ven.5.1397558841827; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id mr9si3329660vec.11.2014.04.15.03.47.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 03:47:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so8981254veb.33 for ; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr744080vcb.19.1397558841745; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp220588vcb; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) X-Received: by 10.224.47.130 with SMTP id n2mr1443872qaf.26.1397558841219; Tue, 15 Apr 2014 03:47:21 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id z89si2771825qgd.88.2014.04.15.03.47.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 15 Apr 2014 03:47:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wa0tT-0008KH-95; Tue, 15 Apr 2014 10:47:11 +0000 Received: from mail-lb0-f169.google.com ([209.85.217.169]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wa0tM-0008K9-U4 for lng-odp@lists.linaro.org; Tue, 15 Apr 2014 10:47:05 +0000 Received: by mail-lb0-f169.google.com with SMTP id q8so6913113lbi.28 for ; Tue, 15 Apr 2014 03:47:07 -0700 (PDT) X-Received: by 10.152.205.98 with SMTP id lf2mr795682lac.60.1397558827525; Tue, 15 Apr 2014 03:47:07 -0700 (PDT) Received: from localhost (c-4f66911e-74736162.cust.telenor.se. [79.102.145.30]) by mx.google.com with ESMTPSA id d9sm18692942laa.17.2014.04.15.03.47.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Apr 2014 03:47:05 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Tue, 15 Apr 2014 12:46:56 +0200 Message-Id: <1397558816-12035-1-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.8.3.2 Subject: [lng-odp] [PATCHv2] test/api_test/odp_atomic: enable testcase 7 X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 wasn't able to run testcase 7, said: "Invalid test case [7]" Signed-off-by: Anders Roxell --- test/api_test/odp_atomic_test.c | 4 +++- test/api_test/odp_atomic_test.h | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c index ea443a0..3f95d3d 100644 --- a/test/api_test/odp_atomic_test.c +++ b/test/api_test/odp_atomic_test.c @@ -17,6 +17,7 @@ static odp_atomic_u64_t a64u; static odp_atomic_int_t numthrds; static const char * const test_name[] = { + "dummy", "test atomic basic ops add/sub/inc/dec", "test atomic inc/dec of signed word", "test atomic add/sub of signed word", @@ -334,10 +335,11 @@ int main(int argc, char *argv[]) thrdarg.testcase = test_type; thrdarg.numthrds = pthrdnum; - if ((test_type > 0) && (test_type < 7)) { + if ((test_type > 0) && (test_type < TEST_MAX)) { printf("%s\n", test_name[test_type]); } else { ODP_ERR("Invalid test case [%d]\n", test_type); + usage(); goto err_exit; } odp_test_thread_create(run_thread, &thrdarg); diff --git a/test/api_test/odp_atomic_test.h b/test/api_test/odp_atomic_test.h index 04dde72..d6eec04 100644 --- a/test/api_test/odp_atomic_test.h +++ b/test/api_test/odp_atomic_test.h @@ -22,14 +22,16 @@ #define U32_INIT_VAL (1UL << 10) #define U64_INIT_VAL (1ULL << 33) -#define TEST_MIX 1 /* Must be first test case num */ -#define TEST_INC_DEC_S32 2 -#define TEST_ADD_SUB_S32 3 -#define TEST_INC_DEC_U32 4 -#define TEST_ADD_SUB_U32 5 -#define TEST_INC_DEC_64 6 -#define TEST_ADD_SUB_64 7 -#define TEST_MAX 7 /* This must match the last test case num */ +typedef enum { + TEST_MIX = 1, /* Must be first test case num */ + TEST_INC_DEC_S32, + TEST_ADD_SUB_S32, + TEST_INC_DEC_U32, + TEST_ADD_SUB_U32, + TEST_INC_DEC_64, + TEST_ADD_SUB_64, + TEST_MAX, +} odp_test_atomic_t; void test_atomic_inc_dec_32(void);