+
+ /* repeat test with precomputed hash functions */
+ hash_sig_t hash_value;
+ int pos1, expectedPos1;
+
+ handle = rte_hash_create(&ut_params);
+ RETURN_IF_ERROR(handle == NULL, "hash creation failed");
+
+ hash_value = rte_hash_hash(handle, &keys[0]);
+ pos1 = rte_hash_add_key_with_hash(handle, &keys[0], hash_value);
+ print_key_info("Add", &keys[0], pos1);
+ RETURN_IF_ERROR(pos1 < 0, "failed to add key (pos1=%d)", pos1);
+ expectedPos1 = pos1;
+
+ pos1 = rte_hash_lookup_with_hash(handle, &keys[0], hash_value);
+ print_key_info("Lkp", &keys[0], pos1);
+ RETURN_IF_ERROR(pos1 != expectedPos1,
+ "failed to find key (pos1=%d)", pos1);
+
+ pos1 = rte_hash_del_key_with_hash(handle, &keys[0], hash_value);
+ print_key_info("Del", &keys[0], pos1);
+ RETURN_IF_ERROR(pos1 != expectedPos1,
+ "failed to delete key (pos1=%d)", pos1);
+
+ pos1 = rte_hash_lookup_with_hash(handle, &keys[0], hash_value);
+ print_key_info("Lkp", &keys[0], pos1);
+ RETURN_IF_ERROR(pos1 != -ENOENT,
+ "fail: found key after deleting! (pos1=%d)", pos1);
+
+ rte_hash_free(handle);
+