From: Brian Aker Date: Thu, 6 Dec 2007 23:31:14 +0000 (-0800) Subject: Modifying tests to always get failures (aka test that failure logic is X-Git-Tag: 0.13~45 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ea724d6626f82e2f6a26222b08725fbe88cb1939;p=m6w6%2Flibmemcached Modifying tests to always get failures (aka test that failure logic is working). Added bug11 test to make sure that default timeout is not too aggressive. --- diff --git a/tests/function.c b/tests/function.c index 98c0092b..b7455c2d 100644 --- a/tests/function.c +++ b/tests/function.c @@ -1387,6 +1387,7 @@ uint8_t user_supplied_bug9(memcached_st *memc) return 0; } +/* We are testing with aggressive timeout to get failures */ uint8_t user_supplied_bug10(memcached_st *memc) { char *key= "foo"; @@ -1397,9 +1398,12 @@ uint8_t user_supplied_bug10(memcached_st *memc) memcached_return rc; unsigned int set= 1; memcached_st *mclone= memcached_clone(NULL, memc); + int32_t timeout; memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, &set); memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set); + timeout= 2; + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout); value = (char*)malloc(value_length * sizeof(char));