diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-11 11:58:44 +0200 |
---|---|---|
committer | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-12 19:33:09 +0200 |
commit | eefc961cc8754208c055d34957e01de46ea50d17 (patch) | |
tree | 3b2032bd59db80f3bf41f06caf2f89e3399cfa72 /test | |
parent | 10d56941d36af3fc017afcf70264f976987c8c36 (diff) |
validation: time: round up resolution
While division the resolution can have fractional part, so better to
round it up, when it's needed.
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/validation/time/time.c b/test/validation/time/time.c index b4e53ec1..d0d198a3 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -40,7 +40,8 @@ static void 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)++; } void time_test_local_res(void) |