{
free(pairs[x].key);
if (pairs[x].value)
+ {
free(pairs[x].value);
+ }
}
free(pairs);
-.TH "HASHKIT_CLONE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CLONE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_clone \- libhashkit Documentation
.
-.TH "HASHKIT_CRC32" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CRC32" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_crc32 \- libhashkit Documentation
.
-.TH "HASHKIT_CREATE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CREATE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_create \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_32" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1_32" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_64" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1_64" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_32" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1A_32" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1a_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_64" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1A_64" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1a_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FREE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FREE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_free \- libhashkit Documentation
.
-.TH "HASHKIT_FUNCTIONS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FUNCTIONS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_functions \- libhashkit Documentation
.
-.TH "HASHKIT_HSIEH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_HSIEH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_hsieh \- libhashkit Documentation
.
-.TH "HASHKIT_IS_ALLOCATED" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_IS_ALLOCATED" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_is_allocated \- libhashkit Documentation
.
-.TH "HASHKIT_JENKINS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_JENKINS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_jenkins \- libhashkit Documentation
.
-.TH "HASHKIT_MD5" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_MD5" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_md5 \- libhashkit Documentation
.
-.TH "HASHKIT_MURMUR" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_MURMUR" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_murmur \- libhashkit Documentation
.
-.TH "HASHKIT_VALUE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_VALUE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_value \- libhashkit Documentation
.
-.TH "LIBHASHKIT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBHASHKIT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libhashkit \- libhashkit Documentation
.
-.TH "LIBMEMCACHED" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached \- Introducing the C Client Library for memcached
.
-.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_check_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_EXAMPLES" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_EXAMPLES" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_examples \- libmemcached Documentation
.
-.TH "LIBMEMCACHEDUTIL" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHEDUTIL" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcachedutil \- libmemcached Documentation
.
-.TH "MEMASLAP" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMASLAP" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memaslap \- libmemcached Documentation
.
-.TH "MEMCACHED" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached \- libmemcached Documentation
.
-.TH "MEMCACHED_ADD" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ADD" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_add \- Storing and Replacing Data
.
-.TH "MEMCACHED_ADD_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ADD_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_add_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_ANALYZE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ANALYZE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_analyze \- libmemcached Documentation
.
-.TH "MEMCACHED_APPEND" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_APPEND" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_append \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_append_by_key \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_AUTO" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_AUTO" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_auto \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_BEHAVIOR" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior_get \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_GET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK_GET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback_get \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_SET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK_SET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CAS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CAS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_cas \- Working with data on the server in an atomic fashion
.
-.TH "MEMCACHED_CAS_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CAS_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_cas_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_CLONE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CLONE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_clone \- libmemcached Documentation
.
-.TH "MEMCACHED_CREATE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CREATE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_create \- libmemcached Documentation
.
-.TH "MEMCACHED_DECREMENT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DECREMENT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_decrement \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_decrement_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DELETE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DELETE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_delete \- libmemcached Documentation
.
-.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_delete_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_destroy_sasl_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_DUMP" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DUMP" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_dump \- libmemcached Documentation
.
-.TH "MEMCACHED_EXIST" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_EXIST" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_exist \- libmemcached Documentation
.
-.TH "MEMCACHED_EXIST_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_EXIST_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_exist_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_FETCH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_RESULT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH_RESULT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch_result \- Retrieving data from the server
.
-.TH "MEMCACHED_FLUSH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FLUSH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_flush \- libmemcached Documentation
.
-.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_flush_buffers \- libmemcached Documentation
.
-.TH "MEMCACHED_FREE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FREE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_free \- libmemcached Documentation
.
-.TH "MEMCACHED_GENERATE_HASH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_generate_hash \- Generating hash values directly
.
-.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_generate_hash_value \- Generating hash values directly
.
-.TH "MEMCACHED_GET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_USER_DATA" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_USER_DATA" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_INCREMENT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_INCREMENT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_increment \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_increment_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_last_error_message \- libmemcached Documentation
.
-.TH "MEMCACHED_LIB_VERSION" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_LIB_VERSION" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_lib_version \- libmemcached Documentation
.
-.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_MGET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_execute_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_POOL" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_behavior_get \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_behavior_set \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_CREATE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_CREATE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_create \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_DESTROY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_DESTROY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_destroy \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_FETCH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_FETCH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_fetch \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_POP" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_POP" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_pop \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_PUSH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_PUSH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_push \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_RELEASE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_RELEASE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_release \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_ST" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_ST" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_st \- libmemcached Documentation
.
-.TH "MEMCACHED_PREPEND" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_PREPEND" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_prepend \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_prepend_by_key \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_QUIT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_QUIT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_quit \- libmemcached Documentation
.
-.TH "MEMCACHED_REPLACE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_REPLACE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_replace \- Storing and Replacing Data
.
-.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_replace_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_RESULT_CAS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_CAS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_cas \- Working with result sets
.
-.TH "MEMCACHED_RESULT_CREATE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_CREATE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_create \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FLAGS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_FLAGS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_flags \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FREE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_FREE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_free \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_key_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_key_value \- Working with result sets
.
-.TH "MEMCACHED_RESULT_LENGTH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_LENGTH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_ST" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_ST" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_st \- Working with result sets
.
-.TH "MEMCACHED_RESULT_VALUE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_VALUE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_value \- Working with result sets
.
-.TH "MEMCACHED_RETURN_T" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RETURN_T" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_return_t \- Return type values
.
-.TH "MEMCACHED_SASL" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SASL" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_sasl \- libmemcached Documentation
.
-.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_sasl_set_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_add \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_add_unix_socket \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_COUNT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_COUNT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_CURSOR" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_CURSOR" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_cursor \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_append \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_free \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_PUSH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_PUSH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_push \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ST" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ST" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_st \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_PARSE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS_PARSE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers_parse \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_RESET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS_RESET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers_reset \- libmemcached Documentation
.
-.TH "MEMCACHED_SET" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_memory_allocators_context \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_USER_DATA" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_USER_DATA" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_EXECUTE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_EXECUTE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_execute \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_get_keys \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_get_value \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_servername \- libmemcached Documentation
.
-.TH "MEMCACHED_STATS" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STATS" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stats \- libmemcached Documentation
.
-.TH "MEMCACHED_STRERROR" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STRERROR" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_strerror \- libmemcached Documentation
.
-.TH "MEMCACHED_TOUCH" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_TOUCH" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_touch \- libmemcached Documentation
.
-.TH "MEMCACHED_TOUCH_BY_KEY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_TOUCH_BY_KEY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_touch_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_USER_DATA" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_USER_DATA" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_VERBOSITY" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_VERBOSITY" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_verbosity \- libmemcached Documentation
.
-.TH "MEMCACHED_VERSION" "3" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_VERSION" "3" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_version \- libmemcached Documentation
.
-.TH "MEMCAPABLE" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCAPABLE" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcapable \- libmemcached Documentation
.
-.TH "MEMCAT" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCAT" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcat \- libmemcached Documentation
.
-.TH "MEMCP" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMCP" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memcp \- libmemcached Documentation
.
-.TH "MEMDUMP" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMDUMP" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memdump \- libmemcached Documentation
.
-.TH "MEMERROR" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMERROR" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memerror \- libmemcached Documentation
.
-.TH "MEMFLUSH" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMFLUSH" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memflush \- libmemcached Documentation
.
-.TH "MEMRM" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMRM" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memrm \- libmemcached Documentation
.
-.TH "MEMSLAP" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMSLAP" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memslap \- libmemcached Documentation
.
-.TH "MEMSTAT" "1" "April 19, 2012" "1.0.6" "libmemcached"
+.TH "MEMSTAT" "1" "April 21, 2012" "1.0.6" "libmemcached"
.SH NAME
memstat \- libmemcached Documentation
.
using namespace libtest;
-static test_return_t _default_callback(void *p)
-{
- (void)p;
-
- return TEST_SUCCESS;
-}
-
Framework::Framework() :
collections(NULL),
_create(NULL),
_destroy(NULL),
- collection_startup(_default_callback),
- collection_shutdown(_default_callback),
- _on_error(NULL),
_runner(NULL),
_socket(false),
_creators_ptr(NULL)
delete _runner;
}
-test_return_t Framework::Item::flush(void* arg, test_st* run)
-{
- if (run->requires_flush and _flush)
- {
- return _flush(arg);
- }
-
- return TEST_SUCCESS;
-}
-
-test_return_t Framework::on_error(const test_return_t rc, void* arg)
-{
- if (_on_error and test_failed(_on_error(rc, arg)))
- {
- return TEST_FAILURE;
- }
-
- return TEST_SUCCESS;
-}
-
-test_return_t Framework::startup(void* arg)
-{
- if (collection_startup)
- {
- return collection_startup(arg);
- }
-
- return TEST_SUCCESS;
-}
-
-test_return_t Framework::Item::startup(void* arg)
-{
- if (_startup)
- {
- return _startup(arg);
- }
-
- return TEST_SUCCESS;
-}
-
libtest::Runner *Framework::runner()
{
if (_runner == NULL)
test_callback_create_fn *_create;
test_callback_destroy_fn *_destroy;
- /* This is called a the beginning of any collection run. */
- test_callback_fn *collection_startup;
-
- /* This is called a the end of any collection run. */
- test_callback_fn *collection_shutdown;
-
- void set_collection_shutdown(test_callback_error_fn *arg)
- {
- _on_error= arg;
- }
-
public:
void* create(test_return_t& arg);
- test_return_t startup(void*);
-
- test_return_t shutdown(void* arg)
- {
- if (collection_shutdown)
- {
- return collection_shutdown(arg);
- }
-
- return TEST_SUCCESS;
- }
-
- /**
- These are run before/after the test. If implemented. Their execution is not controlled
- by the test.
- */
- class Item {
- public:
- /* This is called a the beginning of any run. */
- test_callback_fn *_startup;
-
- test_return_t startup(void*);
-
- /*
- This called on a test if the test requires a flush call (the bool is
- from test_st)
- */
- test_callback_fn *_flush;
-
- public:
-
- Item() :
- _startup(NULL),
- _flush(NULL)
- { }
-
- void set_startup(test_callback_fn *arg)
- {
- _startup= arg;
- }
-
- void set_collection(test_callback_fn *arg)
- {
- _flush= arg;
- }
-
- void set_flush(test_callback_fn *arg)
- {
- _flush= arg;
- }
-
- test_return_t flush(void* arg, test_st* run);
-
- } item;
-
/**
If an error occurs during the test, this is called.
*/
#include <cassert>
#include <cstdlib>
#include <cstring>
+#include <ctime>
+#include <fnmatch.h>
+#include <iostream>
+#include <memory>
+#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
-#include <ctime>
-#include <fnmatch.h>
-#include <iostream>
#include <signal.h>
return s + us;
}
+static test_return_t runner_code(Framework* frame,
+ test_st* run,
+ void* creators_ptr,
+ long int& load_time)
+{ // Runner Code
+
+ struct timeval start_time, end_time;
+
+ gettimeofday(&start_time, NULL);
+ assert(frame->runner());
+ assert(run->test_fn);
+
+ test_return_t return_code;
+ try
+ {
+ return_code= frame->runner()->run(run->test_fn, creators_ptr);
+ }
+ // Special case where check for the testing of the exception
+ // system.
+ catch (libtest::fatal &e)
+ {
+ if (fatal::is_disabled())
+ {
+ fatal::increment_disabled_counter();
+ return_code= TEST_SUCCESS;
+ }
+ else
+ {
+ throw;
+ }
+ }
+
+ gettimeofday(&end_time, NULL);
+ load_time= timedif(end_time, start_time);
+
+ return return_code;
+}
+
#include <getopt.h>
#include <unistd.h>
int exit_code;
- try {
- do {
+ try
+ {
+ do
+ {
exit_code= EXIT_SUCCESS;
- Framework world;
+ std::auto_ptr<Framework> frame(new Framework);
fatal_assert(sigignore(SIGPIPE) == 0);
Stats stats;
- get_world(&world);
+ get_world(frame.get());
test_return_t error;
- void *creators_ptr= world.create(error);
+ void *creators_ptr= frame->create(error);
switch (error)
{
wildcard= argv[2];
}
- for (collection_st *next= world.collections; next and next->name and (not signal.is_shutdown()); next++)
+ for (collection_st *next= frame->collections; next and next->name and (not signal.is_shutdown()); next++)
{
- bool failed= false;
- bool skipped= false;
-
if (collection_to_run.empty() == false and fnmatch(collection_to_run.c_str(), next->name, 0))
{
continue;
stats.collection_total++;
- test_return_t collection_rc= world.startup(creators_ptr);
-
- if (collection_rc == TEST_SUCCESS and next->pre)
- {
- collection_rc= world.runner()->pre(next->pre, creators_ptr);
- }
-
- switch (collection_rc)
- {
- case TEST_SUCCESS:
- break;
-
- case TEST_FAILURE:
- Out << next->name << " [ failed ]";
- failed= true;
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- goto cleanup;
-
- case TEST_SKIPPED:
- Out << next->name << " [ skipping ]";
- skipped= true;
- goto cleanup;
-
- default:
- fatal_message("invalid return code");
- }
-
- Out << "Collection: " << next->name;
-
- for (test_st *run= next->tests; run->name; run++)
+ bool failed= false;
+ bool skipped= false;
+ test_return_t collection_rc;
+ if (test_success(collection_rc= frame->runner()->pre(next->pre, creators_ptr)))
{
- struct timeval start_time, end_time;
- long int load_time= 0;
+ Out << "Collection: " << next->name;
- if (wildcard && fnmatch(wildcard, run->name, 0))
+ for (test_st *run= next->tests; run->name; run++)
{
- continue;
- }
+ long int load_time= 0;
- test_return_t return_code;
- try {
- if (test_success(return_code= world.item.startup(creators_ptr)))
+ if (wildcard && fnmatch(wildcard, run->name, 0))
{
- if (run->requires_flush)
- {
- return_code= world.runner()->flush(creators_ptr);
- }
+ continue;
+ }
- if (test_success(return_code))
+ test_return_t return_code;
+ try
+ {
+ if (run->requires_flush)
{
- { // Runner Code
- gettimeofday(&start_time, NULL);
- assert(world.runner());
- assert(run->test_fn);
- try
- {
- return_code= world.runner()->run(run->test_fn, creators_ptr);
- }
- // Special case where check for the testing of the exception
- // system.
- catch (libtest::fatal &e)
- {
- if (fatal::is_disabled())
- {
- fatal::increment_disabled_counter();
- return_code= TEST_SUCCESS;
- }
- else
- {
- throw;
- }
- }
-
- gettimeofday(&end_time, NULL);
- load_time= timedif(end_time, start_time);
+ if (test_failed(frame->runner()->flush(creators_ptr)))
+ {
+ Error << "frame->runner()->flush(creators_ptr)";
+ continue;
}
}
- else if (return_code == TEST_SKIPPED)
+
+ return_code= runner_code(frame.get(), run, creators_ptr, load_time);
+
+ if (return_code == TEST_SKIPPED)
{ }
else if (return_code == TEST_FAILURE)
{
- Error << " item.flush(failure)";
+#if 0
+ Error << " frame->runner()->run(failure)";
signal.set_shutdown(SHUTDOWN_GRACEFUL);
+#endif
}
+
}
- else if (return_code == TEST_SKIPPED)
- { }
- else if (return_code == TEST_FAILURE)
+ catch (libtest::fatal &e)
{
- Error << " item.startup(failure)";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ Error << "Fatal exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ throw;
+ }
+ catch (std::exception &e)
+ {
+ Error << "Exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ throw;
+ }
+ catch (...)
+ {
+ Error << "Unknown exception occurred";
+ return_code= TEST_FAILURE;
+ throw;
}
- }
-
- catch (libtest::fatal &e)
- {
- Error << "Fatal exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- }
- catch (std::exception &e)
- {
- Error << "Exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- }
- catch (...)
- {
- Error << "Unknown exception occurred";
- return_code= TEST_FAILURE;
- }
- stats.total++;
+ stats.total++;
- switch (return_code)
- {
- case TEST_SUCCESS:
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << load_time / 1000 << "." << load_time % 1000 << "[ " << test_strerror(return_code) << " ]";
- stats.success++;
- break;
-
- case TEST_FAILURE:
- stats.failed++;
- failed= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- case TEST_SKIPPED:
- stats.skipped++;
- skipped= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- default:
- fatal_message("invalid return code");
+ switch (return_code)
+ {
+ case TEST_SUCCESS:
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << load_time / 1000 << "." << load_time % 1000 << "[ " << test_strerror(return_code) << " ]";
+ stats.success++;
+ break;
+
+ case TEST_FAILURE:
+ stats.failed++;
+ failed= true;
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+ break;
+
+ case TEST_SKIPPED:
+ stats.skipped++;
+ skipped= true;
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+ break;
+
+ default:
+ fatal_message("invalid return code");
+ }
+#if 0
+ @TODO add code here to allow for a collection to define a method to reset to allow tests to continue.
+#endif
}
- if (test_failed(world.on_error(return_code, creators_ptr)))
- {
- Error << "Failed while running on_error()";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- break;
- }
+ (void) frame->runner()->post(next->post, creators_ptr);
+ }
+ else if (collection_rc == TEST_FAILURE)
+ {
+ Out << next->name << " [ failed ]";
+ failed= true;
+#if 0
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+#endif
+ }
+ else if (collection_rc == TEST_SKIPPED)
+ {
+ Out << next->name << " [ skipping ]";
+ skipped= true;
}
- (void) world.runner()->post(next->post, creators_ptr);
-
-cleanup:
if (failed == false and skipped == false)
{
stats.collection_success++;
stats.collection_skipped++;
}
- world.shutdown(creators_ptr);
Outn();
}
- if (not signal.is_shutdown())
+ if (signal.is_shutdown() == false)
{
signal.set_shutdown(SHUTDOWN_GRACEFUL);
}
{
Out << "Some tests were skipped.";
}
- else if (stats.collection_success and stats.collection_failed == 0)
+ else if (stats.collection_success and (stats.collection_failed == 0))
{
Out << "All tests completed successfully.";
}
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item.set_flush((test_callback_fn*)world_flush);
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
global_framework= world;
PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole
EXTRA_DIST+= tests/cpp_example.cc
-EXTRA_DIST+= tests/output_plus.res
noinst_HEADERS+= tests/exist.h
-noinst_HEADERS+= tests/keys.hpp
noinst_HEADERS+= tests/hash_results.h
+noinst_HEADERS+= tests/keys.hpp
+noinst_HEADERS+= tests/libmemcached_test_container.h
noinst_HEADERS+= tests/libmemcached_world.h
noinst_HEADERS+= tests/libmemcached_world_socket.h
+noinst_HEADERS+= tests/memc.h
noinst_HEADERS+= tests/runner.h
# Cycle should always run first
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item.set_flush((test_callback_fn*)world_flush);
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
world->set_socket();
};
test_st replication_tests[]= {
+ {"validate replication setup", true, (test_callback_fn*)check_replication_sanity_TEST },
{"set", true, (test_callback_fn*)replication_set_test },
{"get", false, (test_callback_fn*)replication_get_test },
{"mget", false, (test_callback_fn*)replication_mget_test },
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item.set_flush((test_callback_fn*)world_flush);
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
}
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item._flush= (test_callback_fn*)world_flush;
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
}
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, true);
unsigned int check_execute= execute_set(memc, global_pairs, global_count);
- test_compare_warn_hint(global_count, check_execute, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+ test_true(check_execute > (global_count / 2));
return TEST_SUCCESS;
}
unsigned int check_execute= execute_set(memc, global_pairs, global_count);
- test_compare_warn_hint(global_count, check_execute, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+ test_true_hint(check_execute > (global_count / 2),
+ "Possible false, positive, memcached may have ejected key/value based on memory needs");
return TEST_SUCCESS;
}
free(return_value);
}
}
- test_compare_warn_hint(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+ test_true_hint(keys_returned > (global_count / 2),
+ "Possible false, positive, memcached may have ejected key/value based on memory needs");
return TEST_SUCCESS;
}
{
unsigned int keys_returned;
test_compare(TEST_SUCCESS, fetch_all_results(memc, keys_returned));
- test_true(keys_returned > 0);
- test_compare_warn_hint(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+ test_true(keys_returned > (global_count / 2));
}
return TEST_SUCCESS;
total++;
}
}
- test_compare_warn_hint(global_count, total, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+ test_true_hint(total > (global_count / 2),
+ "Possible false, positive, memcached may have ejected key/value based on memory needs");
return TEST_SUCCESS;
}
total++;
}
}
- test_compare_warn_hint(global_count, total, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+
+ test_true_hint(total > (global_count / 2),
+ "Possible false, positive, memcached may have ejected key/value based on memory needs");
return TEST_SUCCESS;
}
}
#define REGRESSION_BINARY_VS_BLOCK_COUNT 20480
-static pairs_st *global_pairs;
+static pairs_st *global_pairs= NULL;
test_return_t key_setup(memcached_st *memc)
{
test_return_t key_teardown(memcached_st *)
{
pairs_free(global_pairs);
+ global_pairs= NULL;
return TEST_SUCCESS;
}
/* First add all of the items.. */
for (ptrdiff_t x= 0; x < REGRESSION_BINARY_VS_BLOCK_COUNT; ++x)
{
- char blob[1024] = {0};
-
- memcached_return_t rc= memcached_add_by_key(memc, "bob", 3, global_pairs[x].key, global_pairs[x].key_length, blob, sizeof(blob), 0, 0);
+ libtest::vchar_t blob;
+ libtest::vchar::make(blob, 1024);
+
+ memcached_return_t rc= memcached_add_by_key(memc,
+ test_literal_param("bob"),
+ global_pairs[x].key, global_pairs[x].key_length,
+ &blob[0], blob.size(),
+ time_t(0), uint32_t(0));
test_true_got(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE, memcached_strerror(NULL, rc));
}
world->_create= world_create;
world->_destroy= world_destroy;
- world->item._startup= reinterpret_cast<test_callback_fn*>(world_test_startup);
- world->item._flush= reinterpret_cast<test_callback_fn*>(world_flush);
- world->_on_error= reinterpret_cast<test_callback_error_fn*>(world_on_error);
-
- world->collection_startup= reinterpret_cast<test_callback_fn*>(world_container_startup);
- world->collection_shutdown= reinterpret_cast<test_callback_fn*>(world_container_shutdown);
-
world->set_runner(new LibmemcachedRunner);
}
#include <tests/replication.h>
#include <tests/debug.h>
+#include "tests/libmemcached-1.0/setup_and_teardowns.h"
+
+test_return_t check_replication_sanity_TEST(memcached_st *memc)
+{
+ test_true(memc);
+ test_true(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL));
+
+ /*
+ * Make sure that we store the item on all servers
+ * (master + replicas == number of servers)
+ */
+ test_compare(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS), uint64_t(memcached_server_count(memc) - 1));
+
+ return TEST_SUCCESS;
+}
+
test_return_t replication_set_test(memcached_st *memc)
{
memcached_return_t rc;
uint32_t flags;
char *val= memcached_get_by_key(memc_clone, key, 1, "bubba", 5,
&len, &flags, &rc);
- test_true(rc == MEMCACHED_SUCCESS);
- test_true(val != NULL);
+ test_compare(MEMCACHED_SUCCESS, rc);
+ test_true(val);
free(val);
}
{
hits++;
}
- test_true(hits == 4);
+ test_compare(4, hits);
memcached_result_free(&result_obj);
}
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item.set_flush((test_callback_fn*)world_flush);
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
world->set_sasl("memcached", "memcached");
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached Client and Server
+ *
+ * Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#pragma once
+
+/* The structure we use for the test system */
+struct libmemcached_test_container_st
+{
+private:
+ memcached_st *_parent;
+
+public:
+ libtest::server_startup_st& construct;
+
+ libmemcached_test_container_st(libtest::server_startup_st &construct_arg) :
+ _parent(NULL),
+ construct(construct_arg)
+ { }
+
+ memcached_st* parent()
+ {
+ return _parent;
+ }
+
+ void parent(memcached_st* arg)
+ {
+ reset();
+ _parent= arg;
+ }
+
+ void reset()
+ {
+ if (_parent)
+ {
+ memcached_free(_parent);
+ _parent= NULL;
+ }
+ }
+
+ ~libmemcached_test_container_st()
+ {
+ reset();
+ }
+};
+
+
#pragma once
-/* The structure we use for the test system */
-struct libmemcached_test_container_st
-{
- libtest::server_startup_st& construct;
- memcached_st *parent;
- memcached_st *memc;
-
- libmemcached_test_container_st(libtest::server_startup_st &construct_arg) :
- construct(construct_arg),
- parent(NULL),
- memc(NULL)
- { }
-};
+#include "tests/libmemcached_test_container.h"
static void *world_create(libtest::server_startup_st& servers, test_return_t& error)
{
return global_container;
}
-static test_return_t world_container_startup(libmemcached_test_container_st *container)
-{
- char buffer[BUFSIZ];
-
- test_compare_got(MEMCACHED_SUCCESS,
- libmemcached_check_configuration(container->construct.option_string().c_str(), container->construct.option_string().size(),
- buffer, sizeof(buffer)),
- container->construct.option_string().c_str());
-
- test_null(container->parent);
- container->parent= memcached(container->construct.option_string().c_str(), container->construct.option_string().size());
- test_true(container->parent);
- test_compare(MEMCACHED_SUCCESS, memcached_version(container->parent));
-
- if (container->construct.sasl())
- {
- if (memcached_failed(memcached_behavior_set(container->parent, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1)))
- {
- memcached_free(container->parent);
- return TEST_FAILURE;
- }
-
- if (memcached_failed(memcached_set_sasl_auth_data(container->parent, container->construct.username().c_str(), container->construct.password().c_str())))
- {
- memcached_free(container->parent);
- return TEST_FAILURE;
- }
- }
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_container_shutdown(libmemcached_test_container_st *container)
-{
- memcached_free(container->parent);
- container->parent= NULL;
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_test_startup(libmemcached_test_container_st *container)
-{
- test_true(container);
- test_null(container->memc);
- test_true(container->parent);
- container->memc= memcached_clone(NULL, container->parent);
- test_true(container->memc);
-
- return TEST_SUCCESS;
-}
-
-test_return_t world_flush(libmemcached_test_container_st *container);
-test_return_t world_flush(libmemcached_test_container_st *container)
-{
- test_true(container->memc);
- memcached_flush(container->memc, 0);
- memcached_quit(container->memc);
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_on_error(test_return_t , libmemcached_test_container_st *container)
-{
- test_true(container->memc);
- memcached_free(container->memc);
- container->memc= NULL;
-
- return TEST_SUCCESS;
-}
-
static bool world_destroy(void *object)
{
libmemcached_test_container_st *container= (libmemcached_test_container_st *)object;
#include <cassert>
-/* The structure we use for the test system */
-struct libmemcached_test_container_st
-{
- libtest::server_startup_st& construct;
- memcached_st *parent;
- memcached_st *memc;
-
- libmemcached_test_container_st(libtest::server_startup_st &construct_arg) :
- construct(construct_arg),
- parent(NULL),
- memc(NULL)
- { }
-};
+#include "tests/libmemcached_test_container.h"
static void *world_create(libtest::server_startup_st& servers, test_return_t& error)
{
return global_container;
}
-static test_return_t world_container_startup(libmemcached_test_container_st *container)
-{
- char buffer[BUFSIZ];
-
- test_compare_got(MEMCACHED_SUCCESS,
- libmemcached_check_configuration(container->construct.option_string().c_str(), container->construct.option_string().size(),
- buffer, sizeof(buffer)),
- container->construct.option_string().c_str());
-
- test_null(container->parent);
- container->parent= memcached(container->construct.option_string().c_str(), container->construct.option_string().size());
- test_true(container->parent);
- test_compare(MEMCACHED_SUCCESS, memcached_version(container->parent));
-
- if (container->construct.sasl())
- {
- if (memcached_failed(memcached_behavior_set(container->parent, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1)))
- {
- memcached_free(container->parent);
- return TEST_FAILURE;
- }
-
- if (memcached_failed(memcached_set_sasl_auth_data(container->parent, container->construct.username().c_str(), container->construct.password().c_str())))
- {
- memcached_free(container->parent);
- return TEST_FAILURE;
- }
- }
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_container_shutdown(libmemcached_test_container_st *container)
-{
- memcached_free(container->parent);
- container->parent= NULL;
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_test_startup(libmemcached_test_container_st *container)
-{
- test_true(container);
- test_null(container->memc);
- test_true(container->parent);
- container->memc= memcached_clone(NULL, container->parent);
- test_true(container->memc);
-
- return TEST_SUCCESS;
-}
-
-test_return_t world_flush(libmemcached_test_container_st *container);
-test_return_t world_flush(libmemcached_test_container_st *container)
-{
- test_true(container->memc);
- memcached_flush(container->memc, 0);
- memcached_quit(container->memc);
-
- return TEST_SUCCESS;
-}
-
-static test_return_t world_on_error(test_return_t , libmemcached_test_container_st *container)
-{
- test_true(container->memc);
- memcached_free(container->memc);
- container->memc= NULL;
-
- return TEST_SUCCESS;
-}
-
static bool world_destroy(void *object)
{
libmemcached_test_container_st *container= (libmemcached_test_container_st *)object;
world->_create= (test_callback_create_fn*)world_create;
world->_destroy= (test_callback_destroy_fn*)world_destroy;
- world->item._startup= (test_callback_fn*)world_test_startup;
- world->item._flush= (test_callback_fn*)world_flush;
- world->_on_error= (test_callback_error_fn*)world_on_error;
-
- world->collection_startup= (test_callback_fn*)world_container_startup;
- world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
-
world->set_runner(new LibmemcachedRunner);
}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Gearmand client and server library.
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+class Memc {
+public:
+ Memc()
+ {
+ _memc= memcached_create(NULL);
+
+ if (_memc == NULL)
+ {
+ throw "memcached_create() failed";
+ }
+ }
+
+ Memc(memcached_st* arg)
+ {
+ _memc= memcached_clone(NULL, arg);
+
+ if (_memc == NULL)
+ {
+ throw "memcached_clone() failed";
+ }
+ }
+
+ memcached_st* operator&() const
+ {
+ return _memc;
+ }
+
+ memcached_st* operator->() const
+ {
+ return _memc;
+ }
+
+ ~Memc()
+ {
+ memcached_free(_memc);
+ }
+
+private:
+ memcached_st *_memc;
+
+};
test_return_t replication_randomize_mget_fail_test(memcached_st *memc);
test_return_t replication_miss_test(memcached_st *memc);
+
+test_return_t check_replication_sanity_TEST(memcached_st*);
#pragma once
#include "tests/libmemcached-1.0/generate.h"
+#include "tests/memc.h"
class LibmemcachedRunner : public libtest::Runner {
public:
test_return_t flush(libmemcached_test_container_st *container)
{
- test_true(container->memc);
- memcached_flush(container->memc, 0);
- memcached_quit(container->memc);
+ Memc memc(container->parent());
+ memcached_flush(&memc, 0);
+ memcached_quit(&memc);
return TEST_SUCCESS;
}
private:
test_return_t _runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
{
+ test_true(container);
+ test_true(container->parent());
+ Memc memc(container->parent());
+
test_compare(true, check());
+ test_return_t ret= TEST_SUCCESS;
if (func)
{
test_true(container);
- test_true(container->memc);
- test_return_t ret;
try {
- ret= func(container->memc);
+ ret= func(&memc);
}
catch (std::exception& e)
{
libtest::Error << e.what();
- return TEST_FAILURE;
+ ret= TEST_FAILURE;
}
-
- return ret;
}
- return TEST_SUCCESS;
+ return ret;
}
test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
{
+ container->reset();
+ {
+ char buffer[BUFSIZ];
+
+ test_compare_got(MEMCACHED_SUCCESS,
+ libmemcached_check_configuration(container->construct.option_string().c_str(), container->construct.option_string().size(),
+ buffer, sizeof(buffer)),
+ container->construct.option_string().c_str());
+
+ test_null(container->parent());
+ container->parent(memcached(container->construct.option_string().c_str(), container->construct.option_string().size()));
+ test_true(container->parent());
+ test_compare(MEMCACHED_SUCCESS, memcached_version(container->parent()));
+
+ if (container->construct.sasl())
+ {
+ if (memcached_failed(memcached_behavior_set(container->parent(), MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1)))
+ {
+ container->reset();
+ return TEST_FAILURE;
+ }
+
+ if (memcached_failed(memcached_set_sasl_auth_data(container->parent(), container->construct.username().c_str(), container->construct.password().c_str())))
+ {
+ container->reset();
+ return TEST_FAILURE;
+ }
+ }
+ }
+
test_compare(true, check());
if (func)
{
- return func(container->parent);
+ return func(container->parent());
}
return TEST_SUCCESS;
test_compare(true, check());
cleanup_pairs(NULL);
+ test_return_t rc= TEST_SUCCESS;
if (func)
{
- return func(container->parent);
+ rc= func(container->parent());
}
+ container->reset();
- return TEST_SUCCESS;
+ return rc;
}
};