diff mbox

[API-NEXT,3/6] validation: time: test time constants in ns

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

Commit Message

Ivan Khoronzhuk Dec. 14, 2015, 6:58 p.m. UTC
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 test/validation/time/time.c | 10 ++++++++++
 test/validation/time/time.h |  1 +
 2 files changed, 11 insertions(+)
diff mbox

Patch

diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index 50d9bdc..4040b9f 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -12,6 +12,15 @@ 
 #define BUSY_LOOP_CNT		30000000    /* used for t > min resolution */
 #define BUSY_LOOP_CNT_LONG	12000000000 /* used for t > 4 sec */
 
+void time_test_odp_constants(void)
+{
+	uint64_t ns;
+
+	ns = ODP_TIME_SEC_IN_NS / 1000;
+	CU_ASSERT(ns == ODP_TIME_MSEC_IN_NS);
+	ns /= 1000;
+	CU_ASSERT(ns == ODP_TIME_USEC_IN_NS);
+}
 
 /* check that related conversions come back to the same value */
 void time_test_odp_conversion(void)
@@ -242,6 +251,7 @@  void time_test_odp_to_u64(void)
 }
 
 odp_testinfo_t time_suite_time[] = {
+	ODP_TEST_INFO(time_test_odp_constants),
 	ODP_TEST_INFO(time_test_odp_conversion),
 	ODP_TEST_INFO(time_test_monotony),
 	ODP_TEST_INFO(time_test_odp_cmp),
diff --git a/test/validation/time/time.h b/test/validation/time/time.h
index b0c67b7..3407138 100644
--- a/test/validation/time/time.h
+++ b/test/validation/time/time.h
@@ -10,6 +10,7 @@ 
 #include <odp_cunit_common.h>
 
 /* test functions: */
+void time_test_odp_constants(void);
 void time_test_odp_conversion(void);
 void time_test_monotony(void);
 void time_test_odp_cmp(void);