tests/mem_functions.cc
/*
  Test case adapted from John Gorman <johngorman2@gmail.com>

  We are testing the error condition when we connect to a server via memcached_get_by_key()
  but find that the server is not available.
*/
Test case adapted from John Gorman 
We are testing the error condition when we connect to a server via memcached_get_by_key()
but find that the server is not available.
Test case adapted from John Gorman We are testing the error condition when we connect to a server via memcached_get_by_key () but find that the server is not available .
static test_return_t memcached_get_by_key_MEMCACHED_ERRNO(memcached_st *memc)
{
  (void)memc;
  memcached_st *tl_memc_h;
  memcached_server_st *servers;
  const char *key= "MemcachedLives";
  size_t len;
  uint32_t flags;
  memcached_return rc;
  char *value;
  tl_memc_h= memcached_create(NULL);
  servers= memcached_servers_parse("localhost:9898,localhost:9899"); 
  memcached_server_push(tl_memc_h, servers);
  memcached_server_list_free(servers);
  value= memcached_get_by_key(tl_memc_h, key, strlen(key), key, strlen(key), &len, &flags, &rc);
  test_false(value);
  test_zero(len);
  test_true(memcached_failed(rc));
  memcached_free(tl_memc_h);
  return TEST_SUCCESS;
}
static test_return_t memcached_get_by_key_MEMCACHED_ERRNO ( memcached_st * memc ) { ( void ) memc ; memcached_st * tl_memc_h ; memcached_server_st * servers ; const char * key = " " ; size_t len ; uint32_t flags ; memcached_return rc ; char * value ; tl_memc_h = memcached_create ( NULL ) ; servers = memcached_servers_parse ( " " ) ; memcached_server_push ( tl_memc_h , servers ) ; memcached_server_list_free ( servers ) ; value = memcached_get_by_key ( tl_memc_h , key , strlen ( key ) , key , strlen ( key ) , & len , & flags , & rc ) ; test_false ( value ) ; test_zero ( len ) ; test_true ( memcached_failed ( rc ) ) ; memcached_free ( tl_memc_h ) ; return TEST_SUCCESS ; }
Test case adapted from John Gorman <johngorman2@gmail.com>
We are testing the error condition when we connect to a server via memcached_get_by_key()
but find that the server is not available.
Test case adapted from John Gorman <johngorman2@gmail . com > We are testing the error condition when we connect to a server via memcached_get_by_key () but find that the server is not available .
// Create a handle. // This server should not exist // See if memcached is reachable.