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

Function test_hash_find_existing

dpdk/app/test/test_hash.c:672–693  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

670 *
671 */
672static int test_hash_find_existing(void)
673{
674 struct rte_hash *handle = NULL, *result = NULL;
675
676 /* Create hash table. */
677 ut_params.name = "hash_find_existing";
678 handle = rte_hash_create(&ut_params);
679 RETURN_IF_ERROR(handle == NULL, "hash creation failed");
680
681 /* Try to find existing hash table */
682 result = rte_hash_find_existing("hash_find_existing");
683 RETURN_IF_ERROR(result != handle, "could not find existing hash table");
684
685 /* Try to find non-existing hash table */
686 result = rte_hash_find_existing("hash_find_non_existing");
687 RETURN_IF_ERROR(!(result == NULL), "found table that shouldn't exist");
688
689 /* Cleanup. */
690 rte_hash_free(handle);
691
692 return 0;
693}
694
695/*
696 * Sequence of operations for 5 keys

Callers 1

test_hashFunction · 0.85

Calls 3

rte_hash_createFunction · 0.85
rte_hash_find_existingFunction · 0.85
rte_hash_freeFunction · 0.85

Tested by

no test coverage detected