From: Date: Tue, 15 Jan 2008 22:41:17 +0000 (-0500) Subject: Adding test for MEMCACHED_BEHAVIOR_USER_DATA X-Git-Tag: 0.14~14 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=42e35b0f96e1f3aabaf6f25969b1fd018ac57911;p=m6w6%2Flibmemcached Adding test for MEMCACHED_BEHAVIOR_USER_DATA --- diff --git a/tests/function.c b/tests/function.c index f52bf783..732f3b04 100644 --- a/tests/function.c +++ b/tests/function.c @@ -881,7 +881,7 @@ uint8_t get_stats_keys(memcached_st *memc) list= memcached_stat_get_keys(memc, &stat, &rc); assert(rc == MEMCACHED_SUCCESS); for (ptr= list; *ptr; ptr++) - printf("Found key %s\n", *ptr); + assert(*ptr); fflush(stdout); free(list); @@ -994,6 +994,15 @@ uint8_t behavior_test(memcached_st *memc) value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE); assert(value > 0); + { + int x= 5; + int *test_ptr; + + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_USER_DATA, &x); + test_ptr= (int *)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_USER_DATA); + assert(*test_ptr == x); + } + return 0; }