tests/parser.cc
/*
  By setting the timeout value to zero, we force poll() to return immediatly.
*/
By setting the timeout value to zero, we force poll() to return immediatly.
By setting the timeout value to zero we force poll () to return immediatly .
test_return_t regression_bug_71231153_connect(memcached_st *)
{
  if (libmemcached_util_ping("10.0.2.252", 0, NULL)) 
    return TEST_SKIPPED;
  { 
    memcached_st *memc= memcached(test_literal_param("--SERVER=10.0.2.252 --CONNECT-TIMEOUT=0"));
    test_true(memc);
    test_zero(memc->connect_timeout);
    test_compare(MEMCACHED_DEFAULT_TIMEOUT, memc->poll_timeout);
    memcached_return_t rc;
    size_t value_len;
    char *value= memcached_get(memc, test_literal_param("test"), &value_len, NULL, &rc);
    test_false(value);
    test_zero(value_len);
    test_compare_got(MEMCACHED_TIMEOUT, rc, memcached_last_error_message(memc));
    memcached_free(memc);
  }
  return TEST_SUCCESS;
}
test_return_t regression_bug_71231153_connect ( memcached_st * ) { if ( libmemcached_util_ping ( " " , 0 , NULL ) ) return TEST_SKIPPED ; { memcached_st * memc = memcached ( test_literal_param ( " " ) ) ; test_true ( memc ) ; test_zero ( memc -> connect_timeout ) ; test_compare ( MEMCACHED_DEFAULT_TIMEOUT , memc -> poll_timeout ) ; memcached_return_t rc ; size_t value_len ; char * value = memcached_get ( memc , test_literal_param ( " " ) , & value_len , NULL , & rc ) ; test_false ( value ) ; test_zero ( value_len ) ; test_compare_got ( MEMCACHED_TIMEOUT , rc , memcached_last_error_message ( memc ) ) ; memcached_free ( memc ) ; } return TEST_SUCCESS ; }
By setting the timeout value to zero, we force poll() to return immediatly.
By setting the timeout value to zero we force poll () to return immediatly .
// If for whatever reason someone has a host at this address, skip // Test the connect-timeout, on a bad host we should get MEMCACHED_CONNECTION_FAILURE