From patchwork Wed Jan 6 13:58:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 59239 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6594060lbb; Wed, 6 Jan 2016 05:59:21 -0800 (PST) X-Received: by 10.140.131.17 with SMTP id 17mr102555029qhd.12.1452088761888; Wed, 06 Jan 2016 05:59:21 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m6si11658069qki.10.2016.01.06.05.59.21; Wed, 06 Jan 2016 05:59:21 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 68CDA617E5; Wed, 6 Jan 2016 13:59:21 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=NSAiyQeN; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 6B109618DF; Wed, 6 Jan 2016 13:58:44 +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 16493617D9; Wed, 6 Jan 2016 13:58:34 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id E4118617D9 for ; Wed, 6 Jan 2016 13:58:32 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id c192so137085309lfe.2 for ; Wed, 06 Jan 2016 05:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uZgoEfDw1IeKEL8sNvi36A5v6Mg7u/h6A6pqGLnFPWU=; b=NSAiyQeN+h+ajk10tKsh4JO5jV2ka3n0j8lAQPYiSTSxKa4wAjumMCaXgScZQ5dwgP Ho0YcOEAhd6qF6gFyVM0mtrY3z7SJ8FDJqeGLWc4FBXK+1lfODo5Rm1wIwcCN4IXy2eM QUFSnNA6D6X/GsME89q7aNZ0laazmvPxFQyEo= 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=uZgoEfDw1IeKEL8sNvi36A5v6Mg7u/h6A6pqGLnFPWU=; b=SmJK1akM8/7lyCxqHCHVV5YPzLTvFEJT4x4DKkim8pmtSzbdD+f4A9OgYIYaTT6L0g 8JJuBJIlOtkgVbmdWrqgwCDHbah2F/hG+91uo5zm7+Bnc7bvcL2CxCMPX21lrnm2tVIA VxdX2kxpHGv9sUtyP84pMBGH4Xlau9nED/74NBr6aQC2Olhgeouc2yTVwHq8gNMpNPyP gLpGoPRUI5mOP+FZqp6UoXy3bubG0suTDBgMrBh+1hrBzdgK1PdoIH1xvy3KgxEXbFcK TUYpnp3Kz0Zt5JPcbb/xkPPHQziTrUaC1SBzPgmDGkS1/nznbpe7h0FrVAtAyogPIDcS +w1w== X-Gm-Message-State: ALoCoQmmXihJKydJFYvImihwx90+lvus2AbhlGjdM0dz0rJ6fdIhYhmlEEJPZuD1U75ZxO2o9+rS7mTnpXrelvbzV+Tab0vd6A== X-Received: by 10.25.28.80 with SMTP id c77mr33973758lfc.74.1452088711656; Wed, 06 Jan 2016 05:58:31 -0800 (PST) Received: from localhost.localdomain ([212.90.63.58]) by smtp.gmail.com with ESMTPSA id rp10sm549796lbb.13.2016.01.06.05.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 05:58:30 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Wed, 6 Jan 2016 15:58:18 +0200 Message-Id: <1452088700-26221-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452088700-26221-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1452088700-26221-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 1/3] validation: time: initialize resolution vars 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" The resolution vars were not initialized at init, as result the resolution is ideal. This patch corrects it, to use real resolution. Signed-off-by: Ivan Khoronzhuk --- test/validation/time/time.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/validation/time/time.c b/test/validation/time/time.c index 8b469b0..5761540 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -31,7 +31,7 @@ void time_test_constants(void) CU_ASSERT(ns == ODP_TIME_USEC_IN_NS); } -static void time_test_res(time_res_cb time_res, uint64_t res) +static int time_test_res(time_res_cb time_res, uint64_t res) { uint64_t rate; @@ -41,16 +41,17 @@ static void time_test_res(time_res_cb time_res, uint64_t res) res = ODP_TIME_SEC_IN_NS / rate; res = res ? res : 1; + return res; } void time_test_local_res(void) { - time_test_res(odp_time_local_res, local_res); + local_res = time_test_res(odp_time_local_res, local_res); } void time_test_global_res(void) { - time_test_res(odp_time_global_res, global_res); + global_res = time_test_res(odp_time_global_res, global_res); } /* check that related conversions come back to the same value */