diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-11 11:58:45 +0200 |
---|---|---|
committer | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-12 19:33:09 +0200 |
commit | ec4fef4cee87fe146996fc42664ed923288efb67 (patch) | |
tree | d332d34a0b9471457f74454831f94177bd57d6bc /test | |
parent | eefc961cc8754208c055d34957e01de46ea50d17 (diff) |
validation: time: increase limit to check to 2 res
In places of two conversions the error can be up to
2 resolutions, so increase validation range to 2 res.
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/validation/time/time.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/validation/time/time.c b/test/validation/time/time.c index d0d198a3..a64bff6d 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 */ |