+static test_return_t hashkit_set_distribution_function_test(hashkit_st *hashk)
+{
+ for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
+ {
+ hashkit_return_t rc;
+
+ rc= hashkit_set_distribution_function(hashk, algo);
+
+ /* Hsieh is disabled most of the time for patent issues */
+ if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH)
+ continue;
+
+ if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_CUSTOM)
+ continue;
+
+ test_true(rc == HASHKIT_SUCCESS);
+ }
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t hashkit_set_custom_distribution_function_test(hashkit_st *hashk)
+{
+ hashkit_return_t rc;
+
+ rc= hashkit_set_custom_distribution_function(hashk, hash_test_function, NULL);
+ test_true(rc == HASHKIT_SUCCESS);
+
+ return TEST_SUCCESS;
+}
+
+
+static test_return_t hashkit_get_function_test(hashkit_st *hashk)
+{
+ for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
+ {
+ hashkit_return_t rc;
+
+ if (HASHKIT_HASH_CUSTOM || HASHKIT_HASH_HSIEH)
+ continue;
+
+ rc= hashkit_set_function(hashk, algo);
+ test_true(rc == HASHKIT_SUCCESS);
+
+ test_true(hashkit_get_function(hashk) == algo);
+ }
+ return TEST_SUCCESS;
+}
+
+static test_return_t hashkit_compare_test(hashkit_st *hashk)
+{
+ hashkit_st *clone;
+
+ clone= hashkit_clone(NULL, hashk);
+
+ test_true(hashkit_compare(clone, hashk));
+ hashkit_free(clone);
+
+ return TEST_SUCCESS;
+}
+