X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=bc9b39a8aa7f783c048c6ef81b15a6c826e50ff3;hb=b30880274b5b866db3780148eaf9bf36e09bb1fb;hp=418077717c8856ae51e397b0b9fdc54ab8f55bcc;hpb=498004747168d79b55b2bc2b61033cea3f72bc88;p=awesomized%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index 41807771..bc9b39a8 100644 --- a/tests/function.c +++ b/tests/function.c @@ -595,6 +595,9 @@ static test_return add_wrapper(memcached_st *memc) #ifdef __sun max= 10; #endif +#ifdef __APPLE__ + max= 10; +#endif for (x= 0; x < max; x++) add_test(memc); @@ -3664,6 +3667,29 @@ static test_return connection_pool_test(memcached_st *memc) for (int x= 0; x < 10; ++x) assert(memcached_pool_push(pool, mmc[x]) == MEMCACHED_SUCCESS); + + /* verify that I can set behaviors on the pool when I don't have all + * of the connections in the pool. It should however be enabled + * when I push the item into the pool + */ + mmc[0]= memcached_pool_pop(pool, false, &rc); + assert(mmc[0] != NULL); + + rc= memcached_pool_behavior_set(pool, MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK, 9999); + assert(rc == MEMCACHED_SUCCESS); + + mmc[1]= memcached_pool_pop(pool, false, &rc); + assert(mmc[1] != NULL); + + assert(memcached_behavior_get(mmc[1], MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK) == 9999); + assert(memcached_pool_push(pool, mmc[1]) == MEMCACHED_SUCCESS); + assert(memcached_pool_push(pool, mmc[0]) == MEMCACHED_SUCCESS); + + mmc[0]= memcached_pool_pop(pool, false, &rc); + assert(memcached_behavior_get(mmc[0], MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK) == 9999); + assert(memcached_pool_push(pool, mmc[0]) == MEMCACHED_SUCCESS); + + assert(memcached_pool_destroy(pool) == memc); return TEST_SUCCESS; }