Free queue and timeouts, destroy timeout pool before termination.
https://bugs.linaro.org/show_bug.cgi?id=1285

Signed-off-by: Ola Liljedahl <[email protected]>
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

Removed reference to Linaro CARDS as this is internal.

 test/validation/odp_timer.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index 88af61b..3e83367 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -336,6 +336,11 @@ static void *worker_entrypoint(void *arg)
        if (ev != ODP_EVENT_INVALID)
                CU_FAIL("Unexpected event received");
 
+       odp_queue_destroy(queue);
+       for (i = 0; i < NTIMERS; i++) {
+               if (tt[i].ev != ODP_EVENT_INVALID)
+                       odp_timeout_free(odp_timeout_from_event(tt[i].ev));
+       }
        LOG_DBG("Thread %u: exiting\n", thr);
        return NULL;
 }
@@ -426,6 +431,10 @@ static void test_odp_timer_all(void)
        /* Destroy timer pool, all timers must have been freed */
        odp_timer_pool_destroy(tp);
 
+       /* Destroy timeout pool, all timeouts must have been freed */
+       int rc = odp_pool_destroy(tbp);
+       CU_ASSERT(rc == 0);
+
        CU_PASS("ODP timer test");
 }
 
-- 
1.9.1


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

Reply via email to