Reviewed-by: Petri Savolainen <[email protected]>

Improves the validation test, but the remaining CU_ASSERT(wait_time > 0) should 
be also removed. Some platform may very well code 
odp_schedule_wait_time((uint64_t)-1LL) to return 0.

uint64_t odp_schedule_wait_time(uint64_t nsec)
{
        if (nsec < 100)
                return NO_WAIT; // can be e.g 1

        if (nsec > 10*YEAR)
                return WAIT;   // can be e.g. 0

        return nsec;  // 100 nsec ... 10 years in nsec
}


-Petri

> -----Original Message-----
> From: EXT Ivan Khoronzhuk [mailto:[email protected]]
> Sent: Thursday, September 10, 2015 7:19 PM
> To: [email protected]; Savolainen, Petri (Nokia - FI/Espoo);
> [email protected]
> Cc: Ivan Khoronzhuk
> Subject: [lng-odp] [PATCH v2 2/2] validation: schedule: don't check
> schedule time on 0
> 
> The ODP_SCHED_NO_WAIT now corresponds to 0, not 1.
> So no need to check it anymore.
> 
> Signed-off-by: Ivan Khoronzhuk <[email protected]>
> ---
>  test/validation/scheduler/scheduler.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/test/validation/scheduler/scheduler.c
> b/test/validation/scheduler/scheduler.c
> index 1874889..39357e7 100644
> --- a/test/validation/scheduler/scheduler.c
> +++ b/test/validation/scheduler/scheduler.c
> @@ -95,9 +95,7 @@ void scheduler_test_wait_time(void)
>       uint64_t wait_time;
> 
>       wait_time = odp_schedule_wait_time(0);
> -
>       wait_time = odp_schedule_wait_time(1);
> -     CU_ASSERT(wait_time > 0);
> 
>       wait_time = odp_schedule_wait_time((uint64_t)-1LL);
>       CU_ASSERT(wait_time > 0);
> --
> 1.9.1

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

Reply via email to