On 12/17/2015 04:29 PM, Ivan Khoronzhuk wrote:
> This function is used to get resolution, test uses it to
> check other APIs.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronz...@linaro.org>
> ---
>  test/validation/time/time.c | 46 
> ++++++++++++++++++++++++++++++---------------
>  test/validation/time/time.h |  1 +
>  2 files changed, 32 insertions(+), 15 deletions(-)
>
> diff --git a/test/validation/time/time.c b/test/validation/time/time.c
> index ce6666f..0fe8c5a 100644
> --- a/test/validation/time/time.c
> +++ b/test/validation/time/time.c
> @@ -8,9 +8,12 @@
>  #include "odp_cunit_common.h"
>  #include "time.h"
>  
> -#define TOLERANCE 1
>  #define BUSY_LOOP_CNT                30000000    /* used for t > min 
> resolution */
>  #define BUSY_LOOP_CNT_LONG   12000000000 /* used for t > 4 sec */
> +#define MIN_TIME_RATE                32000
> +#define MAX_TIME_RATE                15000000000
> +
> +static uint64_t res;
>  
>  void time_test_odp_constants(void)
>  {
> @@ -22,6 +25,18 @@ void time_test_odp_constants(void)
>       CU_ASSERT(ns == ODP_TIME_USEC_IN_NS);
>  }
>  
> +void time_test_res(void)
> +{
> +     uint64_t rate;
> +
> +     rate = odp_time_local_res();
> +     CU_ASSERT(rate > MIN_TIME_RATE);
> +     CU_ASSERT(rate < MAX_TIME_RATE);
> +
> +     res = ODP_TIME_SEC_IN_NS / rate;
> +     res = res ? res : 1;
> +}
> +

Sorry. I'm a bit late on that.
Why can't the clock resolution be lower than 32000 ns ?
As long as resolution is > 0, and not "huge", shouldn't it be OK ?

Nicolas
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to