#include <libhashkit/hashkit.h>
-#include "test.h"
+#include <libtest/test.h>
#include "hash_results.h"
bool _unused;
};
-static test_return_t init_test(void *not_used __attribute__((unused)))
+static test_return_t init_test(void *not_used)
{
hashkit_st hashk;
hashkit_st *hashk_ptr;
+ (void)not_used;
hashk_ptr= hashkit_create(&hashk);
test_true(hashk_ptr);
return TEST_SUCCESS;
}
-static test_return_t allocation_test(void *not_used __attribute__((unused)))
+static test_return_t allocation_test(void *not_used)
{
hashkit_st *hashk_ptr;
+ (void)not_used;
hashk_ptr= hashkit_create(NULL);
test_true(hashk_ptr);
return TEST_SUCCESS;
}
-static test_return_t one_at_a_time_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t one_at_a_time_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t md5_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t md5_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t crc_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t crc_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t fnv1_64_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t fnv1_64_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t fnv1a_64_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t fnv1a_64_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t fnv1_32_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t fnv1_32_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
-
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t fnv1a_32_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t fnv1a_32_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t hsieh_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t hsieh_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
return TEST_SUCCESS;
}
-static test_return_t murmur_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t murmur_run (hashkit_st *hashk)
{
+ (void)hashk;
+
#ifdef WORDS_BIGENDIAN
(void)murmur_values;
return TEST_SKIPPED;
#endif
}
-static test_return_t jenkins_run (hashkit_st *hashk __attribute__((unused)))
+static test_return_t jenkins_run (hashkit_st *hashk)
{
uint32_t x;
const char **ptr;
-
+ (void)hashk;
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++)
{
static test_return_t hashkit_set_function_test(hashkit_st *hashk)
{
- for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
+ for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
{
hashkit_return_t rc;
uint32_t x;
continue;
#endif
- if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_CUSTOM)
+ if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM)
continue;
- test_true(rc == HASHKIT_SUCCESS);
+ test_true_got(rc == HASHKIT_SUCCESS, hashkit_strerror(NULL, rc));
switch (algo)
{
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++)
+ for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
{
hashkit_return_t rc;
if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH)
continue;
- if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_CUSTOM)
+ if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM)
continue;
test_true(rc == HASHKIT_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++)
+ for (hashkit_hash_algorithm_t algo = HASHKIT_HASH_DEFAULT; algo < HASHKIT_HASH_MAX; algo++)
{
hashkit_return_t rc;