X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhash_plus.cc;h=c148d3effd10528ac8cf427ef6bc4447a02df93d;hb=3381db937d9af684deb762143bef0f1632a37dcd;hp=cbf2fdf9dff1ac158c42662086cf583bd6131586;hpb=dac48f2dbe34915755f8f4f7f88419f47dc9e27f;p=m6w6%2Flibmemcached diff --git a/tests/hash_plus.cc b/tests/hash_plus.cc index cbf2fdf9..c148d3ef 100644 --- a/tests/hash_plus.cc +++ b/tests/hash_plus.cc @@ -1,7 +1,8 @@ /* C++ to libhashkit */ -#include "test.h" +#include + #include #include #include @@ -10,16 +11,19 @@ #include "hash_results.h" -static test_return_t exists_test(void *obj __attribute__((unused))) +static test_return_t exists_test(void *obj) { Hashkit hashk; + (void)obj; + (void)hashk; return TEST_SUCCESS; } -static test_return_t new_test(void *obj __attribute__((unused))) +static test_return_t new_test(void *obj) { Hashkit *hashk= new Hashkit; + (void)obj; (void)hashk; @@ -28,10 +32,11 @@ static test_return_t new_test(void *obj __attribute__((unused))) return TEST_SUCCESS; } -static test_return_t copy_test(void *obj __attribute__((unused))) +static test_return_t copy_test(void *obj) { Hashkit *hashk= new Hashkit; Hashkit *copy(hashk); + (void)obj; (void)copy; @@ -40,10 +45,11 @@ static test_return_t copy_test(void *obj __attribute__((unused))) return TEST_SUCCESS; } -static test_return_t assign_test(void *obj __attribute__((unused))) +static test_return_t assign_test(void *obj) { Hashkit hashk; Hashkit copy; + (void)obj; copy= hashk; @@ -52,17 +58,18 @@ static test_return_t assign_test(void *obj __attribute__((unused))) return TEST_SUCCESS; } -static test_return_t digest_test(void *obj __attribute__((unused))) +static test_return_t digest_test(void *obj) { Hashkit hashk; uint32_t value; + (void)obj; value= hashk.digest("Foo", sizeof("Foo")); return TEST_SUCCESS; } -static test_return_t set_function_test(void *obj __attribute__((unused))) +static test_return_t set_function_test(void *obj) { Hashkit hashk; hashkit_hash_algorithm_t algo_list[]= { @@ -78,6 +85,7 @@ static test_return_t set_function_test(void *obj __attribute__((unused))) HASHKIT_HASH_MAX }; hashkit_hash_algorithm_t *algo; + (void)obj; for (algo= algo_list; *algo != HASHKIT_HASH_MAX; algo++) @@ -143,10 +151,11 @@ static test_return_t set_function_test(void *obj __attribute__((unused))) return TEST_SUCCESS; } -static test_return_t set_distribution_function_test(void *obj __attribute__((unused))) +static test_return_t set_distribution_function_test(void *obj) { Hashkit hashk; hashkit_return_t rc; + (void)obj; rc= hashk.set_distribution_function(HASHKIT_HASH_CUSTOM); test_true(rc == HASHKIT_FAILURE); @@ -157,9 +166,10 @@ static test_return_t set_distribution_function_test(void *obj __attribute__((unu return TEST_SUCCESS; } -static test_return_t compare_function_test(void *obj __attribute__((unused))) +static test_return_t compare_function_test(void *obj) { Hashkit a, b; + (void)obj; b= a; @@ -175,14 +185,14 @@ static test_return_t compare_function_test(void *obj __attribute__((unused))) } test_st basic[] ={ - { "exists", 0, exists_test }, - { "new", 0, new_test }, - { "copy", 0, copy_test }, - { "assign", 0, assign_test }, - { "digest", 0, digest_test }, - { "set_function", 0, set_function_test }, - { "set_distribution_function", 0, set_distribution_function_test }, - { "compare", 0, compare_function_test }, + { "exists", 0, reinterpret_cast(exists_test) }, + { "new", 0, reinterpret_cast(new_test) }, + { "copy", 0, reinterpret_cast(copy_test) }, + { "assign", 0, reinterpret_cast(assign_test) }, + { "digest", 0, reinterpret_cast(digest_test) }, + { "set_function", 0, reinterpret_cast(set_function_test) }, + { "set_distribution_function", 0, reinterpret_cast(set_distribution_function_test) }, + { "compare", 0, reinterpret_cast(compare_function_test) }, { 0, 0, 0} };