diff mbox

[3/3] validation: time: increase limit to check to 2 res

Message ID 1452088700-26221-4-git-send-email-ivan.khoronzhuk@linaro.org
State Superseded
Headers show

Commit Message

Ivan Khoronzhuk Jan. 6, 2016, 1:58 p.m. UTC
In places of two conversions the error can be up to
2 resolutions, so increase validation range to 2 res.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 test/validation/time/time.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index 9a3392d..bfb5a23 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -217,8 +217,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 */
@@ -230,8 +230,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 */
@@ -243,8 +243,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 */
@@ -285,8 +285,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 */
@@ -298,8 +298,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 */