> -----Original Message-----
> From: EXT Ivan Khoronzhuk [mailto:[email protected]]
> Sent: Thursday, September 10, 2015 4:00 PM
> To: Savolainen, Petri (Nokia - FI/Espoo); [email protected];
> [email protected]
> Subject: Re: [lng-odp] [Patch 2/2] validation: schedule: don't check
> schedule time on 0
> 
> 
> 
> On 10.09.15 15:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> >
> >
> >> -----Original Message-----
> >> From: EXT Ivan Khoronzhuk [mailto:[email protected]]
> >> Sent: Thursday, September 10, 2015 12:49 PM
> >> To: [email protected]; Savolainen, Petri (Nokia - FI/Espoo);
> >> [email protected]
> >> Cc: Ivan Khoronzhuk
> >> Subject: [lng-odp] [Patch 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 | 3 ---
> >>   1 file changed, 3 deletions(-)
> >>
> >> diff --git a/test/validation/scheduler/scheduler.c
> >> b/test/validation/scheduler/scheduler.c
> >> index 1874889..94facea 100644
> >> --- a/test/validation/scheduler/scheduler.c
> >> +++ b/test/validation/scheduler/scheduler.c
> >> @@ -96,9 +96,6 @@ void scheduler_test_wait_time(void)
> >>
> >>    wait_time = odp_schedule_wait_time(0);
> >
> > This test is OK.
> It's even not tested. But I don't touch it in my series.
> I can push it with separate patch.
> But I tend to add it in this patch like:
> CU_ASSERT(wait_time == ODP_SCHED_NO_WAIT);
> 
> And rename patch on "correct wait time test"
> 
> is it OK for you?
> 
> >
> >>
> >> -  wait_time = odp_schedule_wait_time(1);
> >
> > This is OK.
> >
> >> -  CU_ASSERT(wait_time > 0);
> >
> > This is not. The value returned is implementation specific.
> That's why it's deleted.
> 
> >
> >> -
> >>    wait_time = odp_schedule_wait_time((uint64_t)-1LL);
> >
> > This is OK.
> >
> >>    CU_ASSERT(wait_time > 0);
> >
> > This is not. The value returned is implementation specific.
> Probably better test it here like:
> CU_ASSERT(wait_time != ODP_SCHED_NO_WAIT);
> CU_ASSERT(wait_time != ODP_SCHED_WAIT);
> 
> I'll add it along with proposed test improvements.
> Is it OK for you?
> 
> >
> >
> > So, both asserts should be removed. In addition, wait time should be
> tested with a schedule call ... but that's for another patch.
> Right. But not here.
> Probably with next test like "schedule_wait_time_check"
> and test it with time API?


These are correct test cases:

// calls don't crash
odp_schedule_wait_time(0);
odp_schedule_wait_time(1);
...
odp_schedule_wait_time(-1);


// waits
odp_schedule(NULL, ODP_SCHED_WAIT);


// doesn't wait
odp_schedule(NULL, ODP_SCHED_NO_WAIT);


// wait at least 'ns' nsec
wait_time = odp_schedule_wait_time(ns);
odp_schedule(NULL, wait_time);




Note that ODP_SCHED_WAIT and ODP_SCHED_NO_WAIT
- are inputs to odp_schedule()
- are not inputs to odp_schedule_wait_time()
- are not outputs from odp_schedule_wait_time()


From application (API spec) point of view output from odp_schedule_wait_time() 
is a random value that may or may not match ODP_SCHED_WAIT or 
ODP_SCHED_NO_WAIT. Application uses odp_schedule_wait_time() only when it needs 
to wait for a certain time.



-Petri


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

Reply via email to