Skip to content

Commit

Permalink
validation: timer: add check for odp_timer_capability() return value
Browse files Browse the repository at this point in the history
Test that -1 (and not failure) is returned for unsupported timer clock
sources.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
  • Loading branch information
MatiasElo committed Sep 19, 2023
1 parent 73e5b8a commit 59524e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/validation/api/timer/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 59524e1

Please sign in to comment.