From patchwork Tue Jan 5 14:41:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 59186 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6006101lbb; Tue, 5 Jan 2016 06:41:36 -0800 (PST) X-Received: by 10.28.232.221 with SMTP id f90mr4328537wmi.60.1452004896205; Tue, 05 Jan 2016 06:41:36 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u3si65419679wju.201.2016.01.05.06.41.35; Tue, 05 Jan 2016 06:41:35 -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 4010F6175A; Tue, 5 Jan 2016 14:41:33 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=MVlhGuAg; 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 B39B7616FD; Tue, 5 Jan 2016 14:41:29 +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 0B5BB61745; Tue, 5 Jan 2016 14:41:27 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id B4FF7616D6 for ; Tue, 5 Jan 2016 14:41:25 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id sv6so168415774lbb.0 for ; Tue, 05 Jan 2016 06:41:25 -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; bh=hPqZUVDF++Pc7YmrjLnnJFo4lFU0xXxYv47lPEqw3Nc=; b=MVlhGuAgbEtd05Mtd+/dwcQ1hBcOAU0qYmH6lJuzdETMOywBUrHcszORqzUyVhN6P0 bqARX9VvKlUrqvGfztRaEFcJK58rHCqlS2tGQ7WJIZ2PajbLD4K9Zydc9fprHSiRxZU4 WrHSwN2rvE+3BGF0MVNwzNRyPaOdnvL1/cwZw= 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; bh=hPqZUVDF++Pc7YmrjLnnJFo4lFU0xXxYv47lPEqw3Nc=; b=hawtMFv1LGGgo9Q6zlTa3VI/oAKRUjcTaqAk4hkc8rHDFzI7DUNxfEzyL0aL2dcJxU mecKlFr88ehwmBbH3oo6Y2AI2PmObFPK+gAvHs07Fy5LhaRCvRqs7AnOfXTAl9G5fcMg nfaNWVYjw6LdGcS14cWwEQGQhPe0aUqKni2KLx93bTiXzqHCGLWjIjY6+YZYKtD/vk2e q7Trt489jOQjCEXIB13YY8aXxb/B0eKxaDq5k0H0m+Z3IgMcEr4LqQgsYLV54gWhZpgw UrrZkxoci7NCdQSp0d/DDPB5uhePz28AxpW4l6AkXIvFGpJ4cK1O/ilC3XSOhj7Pi4fu AccQ== X-Gm-Message-State: ALoCoQl1vAiReMfkjtZpM6qH2vfRooXlMBxrXEN0FeFFtXAdEoTEaC1UaRl0K2B8G/N/G/HI4Ax7pMuxfsem5ePtWrAXWPvMfg== X-Received: by 10.112.235.71 with SMTP id uk7mr28695729lbc.39.1452004884472; Tue, 05 Jan 2016 06:41:24 -0800 (PST) Received: from localhost.localdomain ([212.90.63.58]) by smtp.gmail.com with ESMTPSA id zu7sm6290196lbb.36.2016.01.05.06.41.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jan 2016 06:41:23 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Tue, 5 Jan 2016 16:41:17 +0200 Message-Id: <1452004877-15647-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] 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. 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 */