X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fcycle.cc;h=493126bff2548b519fc173a93f57b3e8b012eff9;hb=5a9c49c1e9f1950045eb845277c370324ac9ef16;hp=25ca66cc2d3b9bc1b8bf8ed94df7f5a24ee7b5a2;hpb=12a07e58df95bb8dbe167e4157b29c910177ade8;p=awesomized%2Flibmemcached diff --git a/tests/cycle.cc b/tests/cycle.cc index 25ca66cc..493126bf 100644 --- a/tests/cycle.cc +++ b/tests/cycle.cc @@ -90,6 +90,19 @@ static test_return_t valid(memcached_st *memc) return TEST_SUCCESS; } +static test_return_t kill_test(memcached_st *) +{ + static struct timespec global_sleep_value= { 2, 0 }; + +#ifdef WIN32 + sleep(1); +#else + nanosleep(&global_sleep_value, NULL); +#endif + + return TEST_SUCCESS; +} + test_st ping_tests[] ={ {"alive", true, (test_callback_fn*)alive }, {0, 0, 0} @@ -100,9 +113,15 @@ test_st getpid_tests[] ={ {0, 0, 0} }; +test_st kill_tests[] ={ + {"kill", true, (test_callback_fn*)kill_test }, + {0, 0, 0} +}; + collection_st collection[] ={ {"libmemcached_util_ping()", 0, 0, ping_tests}, {"libmemcached_util_getpid()", 0, 0, getpid_tests}, + {"kill", 0, 0, kill_tests}, {0, 0, 0, 0} };