Message ID | 1452088700-26221-3-git-send-email-ivan.khoronzhuk@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp6594277lbb; Wed, 6 Jan 2016 05:59:48 -0800 (PST) X-Received: by 10.140.18.136 with SMTP id 8mr94302593qgf.64.1452088787972; Wed, 06 Jan 2016 05:59:47 -0800 (PST) Return-Path: <lng-odp-bounces@lists.linaro.org> Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id k77si10871967qgd.75.2016.01.06.05.59.47; Wed, 06 Jan 2016 05:59:47 -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 7E39E618E0; Wed, 6 Jan 2016 13:59:47 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=dNgqBVf+; 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 463FB618E3; Wed, 6 Jan 2016 13:58:47 +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 8A0F2617C9; Wed, 6 Jan 2016 13:58:35 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by lists.linaro.org (Postfix) with ESMTPS id 77595617C9 for <lng-odp@lists.linaro.org>; Wed, 6 Jan 2016 13:58:34 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id oh2so191345703lbb.3 for <lng-odp@lists.linaro.org>; Wed, 06 Jan 2016 05:58:34 -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=mAr9KTxDZ/SKaBSLhF0e53Cd7lBb/+jA8Q/E/ulp7Kc=; b=dNgqBVf+Qqnn/GfUNS9O0luUov2fNEvhnBXC5UypLJOp09ur5O1xujHvVskpLVp1MR 75egVp4djNrui2IaBRWO1hJsPcyM5EvdJLvjFm9ySgFf5kTC/hK48z5iA1Gaw25QwNSX yYSDHYTAvkBzljeds5XMycLqyRAQy+wd6eyIg= 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=mAr9KTxDZ/SKaBSLhF0e53Cd7lBb/+jA8Q/E/ulp7Kc=; b=YiroTKyAA4B9ZFU4pUmOH7DczmUQch5zn4QnC13rpqvjxau+9ZBmVs0DeXthNJPymg u5R/E5YFXIJeeC4IhuO+arNBUIZk9ZpkgHuuO7sIXRhNjOSNs/gO1EgAJ83uHtRVYuuX FPfgWgF8eRq0UDiopdAcYt6OQQrtIQVKIbAr5CpNcAxUqNzhHukIrBxHFqa5rx7Ngt4y EO08Kae/50N/C4yOsVvZLD9lXJQ824acEbpmDq1zRAXvdIFZ95rsF6JbAAxhD+Xp7aQf m2pCkZOEF5dhptzB9NAxyj3tk6fPRlbJDHEi9RSipQQVHVN+/S878HILM7HCnYoCSlo0 U9uQ== X-Gm-Message-State: ALoCoQm0lh5b4jcq/g6kG4qoEN4EFWUgR4mOPinyIPvhOkNaWD7/OVWOeM+Wc+ENdrlfqXsuFLANp5Rn2JZRP6mn9TB0zYgMpg== X-Received: by 10.112.184.199 with SMTP id ew7mr1219136lbc.134.1452088713362; Wed, 06 Jan 2016 05:58:33 -0800 (PST) Received: from localhost.localdomain ([212.90.63.58]) by smtp.gmail.com with ESMTPSA id rp10sm549796lbb.13.2016.01.06.05.58.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 05:58:31 -0800 (PST) From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> To: lng-odp@lists.linaro.org Date: Wed, 6 Jan 2016 15:58:19 +0200 Message-Id: <1452088700-26221-3-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 2/3] validation: time: round up resolution X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" <lng-odp.lists.linaro.org> List-Unsubscribe: <https://lists.linaro.org/mailman/options/lng-odp>, <mailto:lng-odp-request@lists.linaro.org?subject=unsubscribe> List-Archive: <http://lists.linaro.org/pipermail/lng-odp/> List-Post: <mailto:lng-odp@lists.linaro.org> List-Help: <mailto:lng-odp-request@lists.linaro.org?subject=help> List-Subscribe: <https://lists.linaro.org/mailman/listinfo/lng-odp>, <mailto:lng-odp-request@lists.linaro.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" <lng-odp-bounces@lists.linaro.org> |
diff --git a/test/validation/time/time.c b/test/validation/time/time.c index 5761540..9a3392d 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -40,7 +40,9 @@ static int time_test_res(time_res_cb time_res, uint64_t res) CU_ASSERT(rate < MAX_TIME_RATE); res = ODP_TIME_SEC_IN_NS / rate; - res = res ? res : 1; + if (ODP_TIME_SEC_IN_NS % rate) + res++; + return res; }
While division the resolution can have fractional part, so better to round it up, when it's needed. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> --- test/validation/time/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)