From: Date: Sun, 2 Dec 2007 00:30:41 +0000 (-0800) Subject: Extending test cases (Hsieh has benchmarks now run by default) X-Git-Tag: 0.13~56 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c2f8357ab8824490ac5df233ab1dbba52989ac97;p=m6w6%2Flibmemcached Extending test cases (Hsieh has benchmarks now run by default) --- diff --git a/tests/function.c b/tests/function.c index fe4b2d86..2450b0dd 100644 --- a/tests/function.c +++ b/tests/function.c @@ -1672,7 +1672,16 @@ memcached_return pre_hash_ketama(memcached_st *memc) memcached_return enable_consistent(memcached_st *memc) { memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT; + memcached_hash hash; memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, &value); + pre_hsieh(memc); + + value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION); + assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT); + + hash= (memcached_hash)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH); + assert(hash == MEMCACHED_HASH_HSIEH); + return MEMCACHED_SUCCESS; } @@ -1866,6 +1875,8 @@ collection_st collection[] ={ {"user", 0, 0, user_tests}, {"generate", 0, 0, generate_tests}, {"generate_hsieh", pre_hsieh, 0, generate_tests}, + {"generate_hsieh_consistent", enable_consistent, 0, generate_tests}, + {"generate_md5", pre_md5, 0, generate_tests}, {"generate_nonblock", pre_nonblock, 0, generate_tests}, {0, 0, 0, 0} }; diff --git a/tests/test.c b/tests/test.c index 765149ec..990f15e7 100644 --- a/tests/test.c +++ b/tests/test.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "test.h" @@ -119,7 +120,7 @@ int main(int argc, char *argv[]) test_st *run; run= next->tests; - if (collection_to_run && strcmp(collection_to_run, next->name)) + if (collection_to_run && fnmatch(collection_to_run, next->name, FNM_CASEFOLD)) continue; fprintf(stderr, "\n%s\n\n", next->name); @@ -131,7 +132,7 @@ int main(int argc, char *argv[]) memcached_return rc; struct timeval start_time, end_time; - if (wildcard && strcmp(wildcard, run->name)) + if (wildcard && fnmatch(wildcard, run->name, FNM_CASEFOLD)) continue; fprintf(stderr, "Testing %s", run->name);