Added function to pause and exit the schedule loop
according to the API.

Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
---
 test/validation/odp_schedule.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/validation/odp_schedule.c b/test/validation/odp_schedule.c
index 0f659b8..b168766 100644
--- a/test/validation/odp_schedule.c
+++ b/test/validation/odp_schedule.c
@@ -58,6 +58,25 @@ typedef struct {
 
 odp_pool_t pool;
 
+static int exit_schedule_loop(void)
+{
+       odp_event_t ev;
+       int ret = 0;
+
+       odp_schedule_pause();
+
+       while ((ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT))
+             != ODP_EVENT_INVALID) {
+               odp_buffer_t buf;
+
+               buf = odp_buffer_from_event(ev);
+               odp_buffer_free(buf);
+               ret++;
+       }
+
+       return ret;
+}
+
 static void test_schedule_wait_time(void)
 {
        uint64_t wait_time;
@@ -579,6 +598,8 @@ static void test_schedule_pause_resume(void)
                buf = odp_buffer_from_event(ev);
                odp_buffer_free(buf);
        }
+
+       CU_ASSERT(exit_schedule_loop() == 0);
 }
 
 static int create_queues(void)
-- 
2.3.4


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

Reply via email to