diff mbox

[1/3] validation: time: initialize resolution vars

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

Commit Message

Ivan Khoronzhuk Jan. 6, 2016, 1:58 p.m. UTC
The resolution vars were not initialized at init, as result the resolution
is ideal. This patch corrects it, to use real resolution.

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

Patch

diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index 8b469b0..5761540 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -31,7 +31,7 @@  void time_test_constants(void)
 	CU_ASSERT(ns == ODP_TIME_USEC_IN_NS);
 }
 
-static void time_test_res(time_res_cb time_res, uint64_t res)
+static int time_test_res(time_res_cb time_res, uint64_t res)
 {
 	uint64_t rate;
 
@@ -41,16 +41,17 @@  static void time_test_res(time_res_cb time_res, uint64_t res)
 
 	res = ODP_TIME_SEC_IN_NS / rate;
 	res = res ? res : 1;
+	return res;
 }
 
 void time_test_local_res(void)
 {
-	time_test_res(odp_time_local_res, local_res);
+	local_res = time_test_res(odp_time_local_res, local_res);
 }
 
 void time_test_global_res(void)
 {
-	time_test_res(odp_time_global_res, global_res);
+	global_res = time_test_res(odp_time_global_res, global_res);
 }
 
 /* check that related conversions come back to the same value */