From patchwork Mon Jan 11 09:58:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 59450 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2006798lbb; Mon, 11 Jan 2016 02:00:57 -0800 (PST) X-Received: by 10.55.73.6 with SMTP id w6mr86406237qka.82.1452506457529; Mon, 11 Jan 2016 02:00:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z203si24016659qka.44.2016.01.11.02.00.55; Mon, 11 Jan 2016 02:00:57 -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 C22DC616C5; Mon, 11 Jan 2016 10:00:55 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=jGSx/Vm8; 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 3FD616167F; Mon, 11 Jan 2016 09:59:22 +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 8C12A6167F; Mon, 11 Jan 2016 09:59:17 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id C41E8616BD for ; Mon, 11 Jan 2016 09:58:57 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id h129so14328831lfh.3 for ; Mon, 11 Jan 2016 01:58:57 -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=mjn19T2G5LtRAZe0S6JtQdnIZwi+4Qew2xOMxj5+LbA=; b=jGSx/Vm8IzSo4uN7C0VVrcGfJZuODROCJ9/My2Lr1wo/J62oi90Oh+WoYqB2cPHOmK XU1Sc9W6ygZKFQvDhzbMI6fxW5i6nvjDPkSEq3XwEujI/XuWDvyaaWrHvSrxxUnUfM9a Ejlnrm2x7D2V523Gsy/sXaKGBNn+gg1eFWnwY= 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=mjn19T2G5LtRAZe0S6JtQdnIZwi+4Qew2xOMxj5+LbA=; b=H2basW9Fshh8FR1ZyEazmYdOQHTyGY07xOJZnWRAXRH597KSgBexkY0lrIio7FyXf6 JOoJiRL5GJFK7oIXCaguT4p5fUL6JhSFliFUd3eiCa/q3jushLntClIRHG3TROIm2yeS 7Ba6izd8NC0LEGyKlZm9xOo/CmUA6iR3hLrsGEGZH7yaxBzkS38ALKTB1dCzJ6XqBM0G rwIXaOAP1eiXyRddrLaMinGgnss7esbaRC7DCiguMn6Wf5i/ZJBb1+HD1dVLyuKNSo47 Z+LzjT3nUlO8OXBsFukc3n7lwpPQxVcw8eqwLugTvnjD51n/RIpDRmEfMkwczSF9PyLI FUpQ== X-Gm-Message-State: ALoCoQlrYV2bRQsHhlsFCwiFxo4xaNtY9LNHTa5jWa667mr4ff36ic61yEM1c1cHrVHkLkQ7j04O5L2pV0kYix4Fx8ScwsHvZQ== X-Received: by 10.25.88.77 with SMTP id m74mr4859632lfb.149.1452506336608; Mon, 11 Jan 2016 01:58:56 -0800 (PST) Received: from localhost.localdomain ([212.90.63.58]) by smtp.gmail.com with ESMTPSA id 87sm15384153lfr.44.2016.01.11.01.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 01:58:55 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Mon, 11 Jan 2016 11:58:45 +0200 Message-Id: <1452506325-12479-4-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452506325-12479-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1452506325-12479-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 3/3] validation: time: increase limit to check to 2 res 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" In places of two conversions the error can be up to 2 resolutions, so increase validation range to 2 res. Reviewed-by: Bill Fischofer Signed-off-by: Ivan Khoronzhuk --- test/validation/time/time.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/validation/time/time.c b/test/validation/time/time.c index d0d198a..a64bff6 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -215,8 +215,8 @@ static void time_test_diff(time_cb time, ns = ns2 - ns1; nsdiff = odp_time_to_ns(diff); - upper_limit = ns + res; - lower_limit = ns - res; + upper_limit = ns + 2 * res; + lower_limit = ns - 2 * res; CU_ASSERT((nsdiff <= upper_limit) && (nsdiff >= lower_limit)); /* test timestamp and interval diff */ @@ -228,8 +228,8 @@ static void time_test_diff(time_cb time, CU_ASSERT(odp_time_cmp(diff, ODP_TIME_NULL) > 0); nsdiff = odp_time_to_ns(diff); - upper_limit = ns + res; - lower_limit = ns - res; + upper_limit = ns + 2 * res; + lower_limit = ns - 2 * res; CU_ASSERT((nsdiff <= upper_limit) && (nsdiff >= lower_limit)); /* test interval diff */ @@ -241,8 +241,8 @@ static void time_test_diff(time_cb time, CU_ASSERT(odp_time_cmp(diff, ODP_TIME_NULL) > 0); nsdiff = odp_time_to_ns(diff); - upper_limit = ns + res; - lower_limit = ns - res; + upper_limit = ns + 2 * res; + lower_limit = ns - 2 * res; CU_ASSERT((nsdiff <= upper_limit) && (nsdiff >= lower_limit)); /* same time has to diff to 0 */ @@ -283,8 +283,8 @@ static void time_test_sum(time_cb time, CU_ASSERT(odp_time_cmp(sum, ODP_TIME_NULL) > 0); nssum = odp_time_to_ns(sum); - upper_limit = ns + res; - lower_limit = ns - res; + upper_limit = ns + 2 * res; + lower_limit = ns - 2 * res; CU_ASSERT((nssum <= upper_limit) && (nssum >= lower_limit)); /* sum intervals */ @@ -296,8 +296,8 @@ static void time_test_sum(time_cb time, CU_ASSERT(odp_time_cmp(sum, ODP_TIME_NULL) > 0); nssum = odp_time_to_ns(sum); - upper_limit = ns + res; - lower_limit = ns - res; + upper_limit = ns + 2 * res; + lower_limit = ns - 2 * res; CU_ASSERT((nssum <= upper_limit) && (nssum >= lower_limit)); /* test on 0 */