From 7e1021b8ba811bdfdeef1b14ea3832b2590d2367 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 1 Sep 2023 15:09:50 +0300 Subject: [PATCH] validation: pool: improve odp_pool_ext_capability() tests Add tests to validate that odp_pool_ext_capability() works according to the specification when unsupported pool type is used. Signed-off-by: Matias Elo --- test/validation/api/pool/pool.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 5176bb96f2d..af6392e45fe 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -1698,7 +1698,19 @@ static void pool_ext_init_packet_pool_param(odp_pool_ext_param_t *param) static void test_packet_pool_ext_capa(void) { odp_pool_ext_capability_t capa; - odp_pool_type_t type = ODP_POOL_PACKET; + odp_pool_type_t type; + const odp_pool_type_t unsupported_types[] = {ODP_POOL_BUFFER, ODP_POOL_TIMEOUT, + ODP_POOL_VECTOR, ODP_POOL_DMA_COMPL}; + const int num_types = sizeof(unsupported_types) / sizeof(unsupported_types[0]); + + /* Verify operation for unsupported pool types */ + for (int i = 0; i < num_types; i++) { + type = unsupported_types[i]; + CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0); + CU_ASSERT(capa.max_pools == 0); + } + + type = ODP_POOL_PACKET; CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0);