Skip to content

Commit

Permalink
validation: pool: improve odp_pool_ext_capability() tests
Browse files Browse the repository at this point in the history
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 <matias.elo@nokia.com>
  • Loading branch information
MatiasElo committed Sep 8, 2023
1 parent 74c9816 commit 7e1021b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/validation/api/pool/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7e1021b

Please sign in to comment.