From 59524e105b9b8696bda29c144086615149ea405b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 16:28:56 +0300 Subject: [PATCH] validation: timer: add check for odp_timer_capability() return value Test that -1 (and not failure) is returned for unsupported timer clock sources. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/validation/api/timer/timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 9b08847f9f..ac65aac2b2 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -366,9 +366,17 @@ static void timer_test_capa(void) #endif for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) { + odp_timer_capability_t capa; + int ret; + clk_src = ODP_CLOCK_SRC_0 + i; + + ret = odp_timer_capability(clk_src, &capa); + CU_ASSERT(ret == 0 || ret == -1); + if (global_mem->clk_supported[i]) { ODPH_DBG("\nTesting clock source: %i\n", clk_src); + CU_ASSERT(ret == 0); timer_test_capa_run(clk_src); } }