MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_fbk_hash_find_existing

Function test_fbk_hash_find_existing

dpdk/app/test/test_hash.c:1306–1332  ·  view source on GitHub ↗

* Sequence of operations for find existing fbk hash table * * - create table * - find existing table: hit * - find non-existing table: miss * */

Source from the content-addressed store, hash-verified

1304 *
1305 */
1306static int test_fbk_hash_find_existing(void)
1307{
1308 struct rte_fbk_hash_params params = {
1309 .name = "fbk_hash_find_existing",
1310 .entries = LOCAL_FBK_HASH_ENTRIES_MAX,
1311 .entries_per_bucket = 4,
1312 .socket_id = 0,
1313 };
1314 struct rte_fbk_hash_table *handle = NULL, *result = NULL;
1315
1316 /* Create hash table. */
1317 handle = rte_fbk_hash_create(&params);
1318 RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation failed");
1319
1320 /* Try to find existing fbk hash table */
1321 result = rte_fbk_hash_find_existing("fbk_hash_find_existing");
1322 RETURN_IF_ERROR_FBK(result != handle, "could not find existing fbk hash table");
1323
1324 /* Try to find non-existing fbk hash table */
1325 result = rte_fbk_hash_find_existing("fbk_hash_find_non_existing");
1326 RETURN_IF_ERROR_FBK(!(result == NULL), "found fbk table that shouldn't exist");
1327
1328 /* Cleanup. */
1329 rte_fbk_hash_free(handle);
1330
1331 return 0;
1332}
1333
1334#define BUCKET_ENTRIES 4
1335/*

Callers 1

test_hashFunction · 0.85

Calls 3

rte_fbk_hash_createFunction · 0.85
rte_fbk_hash_freeFunction · 0.85

Tested by

no test coverage detected