X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=03df4da2f6da50cc476510be50c698084937806e;hb=8f4f53d570ffa167f08912242c1a41d6f314ac0b;hp=826e6c82e808961849f68025d366cb048c34d492;hpb=151d417315c7ef9a1eaa0fe21150d8e0ec9eb440;p=awesomized%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index 826e6c82..03df4da2 100644 --- a/tests/function.c +++ b/tests/function.c @@ -67,7 +67,7 @@ memcached_return server_display_function(memcached_st *ptr, memcached_server_st /* Do Nothing */ uint32_t bigger= *((uint32_t *)(context)); assert(bigger <= server->port); - *((uint32_t *)(context))= bigger; + *((uint32_t *)(context))= server->port; return MEMCACHED_SUCCESS; } @@ -117,13 +117,13 @@ uint8_t server_unsort_test(memcached_st *ptr) { uint8_t x; uint32_t counter= 0; /* Prime the value for the assert in server_display_function */ + uint32_t bigger= 0; /* Prime the value for the assert in server_display_function */ memcached_return rc; memcached_server_function callbacks[1]; memcached_st *local_memc; local_memc= memcached_create(NULL); assert(local_memc); - memcached_behavior_set(local_memc, MEMCACHED_BEHAVIOR_SORT_HOSTS, 1); for (x= 0; x < TEST_PORT_COUNT; x++) { @@ -137,6 +137,11 @@ uint8_t server_unsort_test(memcached_st *ptr) callbacks[0]= server_display_unsort_function; memcached_server_cursor(local_memc, callbacks, (void *)&counter, 1); + /* Now we sort old data! */ + memcached_behavior_set(local_memc, MEMCACHED_BEHAVIOR_SORT_HOSTS, 1); + callbacks[0]= server_display_function; + memcached_server_cursor(local_memc, callbacks, (void *)&bigger, 1); + memcached_free(local_memc);