From patchwork Thu Sep 25 10:47:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 37916 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 571B820560 for ; Thu, 25 Sep 2014 10:48:10 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf4816647eek.9 for ; Thu, 25 Sep 2014 03:48:09 -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=jrrrI8sViC6BtVOutcyz6b3Pzo0Qf2x8DhijLxdExV8=; b=XtUemV1oLADyXcZwYY/CvmwI0wexQ1V9lKTicLx2lufgjOubI3m4PigLauAN4Wd2Ek JikDSWi6LWRvodMcaBiKDimFu19HWToNgeX6axrgzZrUCiriTQJN72AdtbuXR4mryThy /FfeI6G6X2+q5HIbnukhBchuQ/hNulmESqZzXTOLGk7q+N67PaIOof5iUOWrNunbMz2g vJegNaihGOCUO5motyINikCCfypemHXQ3/1iUqTVMRNk6YdjIJczNLW07PkhZEsUyuPQ zhqNj4IU+f8F/avHrcsiZaCFyRHjVPsg+wyJ6sk+e1QlErgcu6ONzydPhsm+gppb/eZr nrNQ== X-Gm-Message-State: ALoCoQm8UnRZ7ckNetL4wiCATwXYFvhEWHvEwmmM4gXGvElClHPDPthyAPx/OU8RwOYOsnvrYOtP X-Received: by 10.180.81.226 with SMTP id d2mr5011329wiy.5.1411642089190; Thu, 25 Sep 2014 03:48:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.169 with SMTP id s9ls223191laa.47.gmail; Thu, 25 Sep 2014 03:48:08 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr12194537lat.67.1411642088853; Thu, 25 Sep 2014 03:48:08 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id o6si2401199lbc.99.2014.09.25.03.48.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Sep 2014 03:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id gb8so2785029lab.16 for ; Thu, 25 Sep 2014 03:48:08 -0700 (PDT) X-Received: by 10.152.7.8 with SMTP id f8mr12270618laa.27.1411642088743; Thu, 25 Sep 2014 03:48:08 -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.112.130.169 with SMTP id of9csp727640lbb; Thu, 25 Sep 2014 03:48:08 -0700 (PDT) X-Received: by 10.140.98.11 with SMTP id n11mr3490096qge.83.1411642087573; Thu, 25 Sep 2014 03:48:07 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id b11si1922264qgb.101.2014.09.25.03.48.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 25 Sep 2014 03:48:07 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XX6aj-0008Fm-2A; Thu, 25 Sep 2014 10:48:05 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XX6ac-0008Fb-TO for lng-odp@lists.linaro.org; Thu, 25 Sep 2014 10:47:59 +0000 Received: by mail-pa0-f46.google.com with SMTP id kx10so10635173pab.5 for ; Thu, 25 Sep 2014 03:47:53 -0700 (PDT) X-Received: by 10.70.65.34 with SMTP id u2mr25031193pds.58.1411642073240; Thu, 25 Sep 2014 03:47:53 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id qp9sm1836084pbc.31.2014.09.25.03.47.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Sep 2014 03:47:52 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Thu, 25 Sep 2014 16:17:27 +0530 Message-Id: <1411642048-19451-1-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: timers patch Subject: [lng-odp] [ODP/PATCH 1/2] test_api: timer: odp_timer_create error check 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: santosh.shukla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) 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 Also set appropriate timer resolution. w/o this error check odp ping application will segfault. Signed-off-by: Santosh Shukla Tested-by: Ankit Jindal --- test/api_test/odp_timer_ping.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index 5ae379f..29a6392 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -43,6 +43,11 @@ #define PING_CNT 10 #define PING_THRD 2 /* Send and Rx Ping thread */ +/* Nanoseconds */ +#define RESUS 10000 +#define MINUS 10000 +#define MAXUS 10000000 + static odp_timer_t test_timer_ping; static odp_timer_tmo_t test_ping_tmo; @@ -353,7 +358,15 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) } test_timer_ping = odp_timer_create("ping_timer", pool, - 1000000, 1000000, 1000000000000UL); + RESUS*ODP_TIME_USEC, + MINUS*ODP_TIME_USEC, + MAXUS*ODP_TIME_USEC); + + if (test_timer_ping == ODP_TIMER_INVALID) { + ODP_ERR("Timer create failed.\n"); + return -1; + } + odp_shm_print_all(); pingarg.thrdarg.testcase = ODP_TIMER_PING_TEST;