* Sequence of operations for find existing hash table * * - create table * - find existing table: hit * - find non-existing table: miss * */
| 670 | * |
| 671 | */ |
| 672 | static 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 |
no test coverage detected