X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flibmemcached-1.0%2Fpool.cc;h=ed290ab9281374488bc93c25964a62639e342f1f;hb=5db4ece0e8254a205d10e8fda842120a001c17c8;hp=30cc9660a06e7ad1c244d50c01c1ee7464170d1a;hpb=76bf27c007d5015d3dcf2981c942d8afb2e97302;p=awesomized%2Flibmemcached diff --git a/tests/libmemcached-1.0/pool.cc b/tests/libmemcached-1.0/pool.cc index 30cc9660..ed290ab9 100644 --- a/tests/libmemcached-1.0/pool.cc +++ b/tests/libmemcached-1.0/pool.cc @@ -243,10 +243,7 @@ struct test_pool_context_st { static __attribute__((noreturn)) void* connection_release(void *arg) { test_pool_context_st *resource= static_cast(arg); - if (resource == NULL) - { - fatal_message("resource == NULL"); - } + FATAL_IF(resource == NULL); // Release all of the memc we are holding resource->rc= memcached_pool_release(resource->pool, resource->mmc); @@ -396,17 +393,11 @@ static bool _running= false; static void set_running(const bool arg) { int error; - if ((error= pthread_mutex_lock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_lock(&mutex)) != 0, strerror(error)); _running= arg; - if ((error= pthread_mutex_unlock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_unlock(&mutex)) != 0, strerror(error)); } static bool running() @@ -414,17 +405,11 @@ static bool running() int error; bool ret; - if ((error= pthread_mutex_lock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_lock(&mutex)) != 0, strerror(error)); ret= _running; - if ((error= pthread_mutex_unlock(&mutex)) != 0) - { - fatal_message(strerror(error)); - } + FATAL_IF_((error= pthread_mutex_unlock(&mutex)) != 0, strerror(error)); return ret; } @@ -504,15 +489,9 @@ test_return_t regression_bug_962815(memcached_st *memc) test_compare(0, pthread_join(pid[x], NULL)); } - if (pool) - { - memcached_pool_destroy(pool); - } + memcached_pool_destroy(pool); - if (master) - { - memcached_free(master); - } + memcached_free(master); return TEST_SUCCESS; }