On 21.12.15 10:50, Savolainen, Petri (Nokia - FI/Espoo) wrote:


-----Original Message-----
From: EXT Ivan Khoronzhuk [mailto:[email protected]]
Sent: Friday, December 18, 2015 2:14 PM
To: [email protected]
Cc: Savolainen, Petri (Nokia - FI/Espoo); Ivan Khoronzhuk
Subject: [lng-odp] [API-NEXT PATCH 2/2] validation: time: update to tes
global time API also

Mostly global time API is tested in the same way, so reuse
existent functions.

Signed-off-by: Ivan Khoronzhuk <[email protected]>
---
  test/validation/time/time.c | 160 +++++++++++++++++++++++++++++++++------
-----
  test/validation/time/time.h |  23 ++++---
  2 files changed, 137 insertions(+), 46 deletions(-)

diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index add1be8..8ef095e 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -14,9 +14,10 @@
  #define MAX_TIME_RATE         15000000000
  #define DELAY_TOLERANCE               20000000            /* deviation for 
delay
*/

-static uint64_t res;
+static uint64_t local_res;
+static uint64_t global_res;

-void time_test_odp_constants(void)
+void time_test_constants(void)
  {
        uint64_t ns;

@@ -26,11 +27,11 @@ void time_test_odp_constants(void)
        CU_ASSERT(ns == ODP_TIME_USEC_IN_NS);
  }

-void time_test_res(void)
+static void time_test_res(uint64_t time_res(void), uint64_t res)
                              ^^^^^^^^^^^^^^^^^^^^^^^


I'd typedef all these callback function prototypes. Some of those prototypes 
are defined multiple times.
 Also  the function parameter list is more readable when callbacks are 
typedef'ed.


-Petri
IMHO, it's more readable when it's not typedefed.






  {
        uint64_t rate;

-       rate = odp_time_local_res();
+       rate = time_res();
        CU_ASSERT(rate > MIN_TIME_RATE);
        CU_ASSERT(rate < MAX_TIME_RATE);

@@ -38,15 +39,26 @@ void time_test_res(void)
        res = res ? res : 1;
  }

--
Regards,
Ivan Khoronzhuk
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to