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()
  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()
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 () but find that the server is not available .
static test_return_t memcached_get_MEMCACHED_ERRNO(memcached_st *)
{
  const char *key= "MemcachedLives";
  size_t len;
  uint32_t flags;
  memcached_return rc;
  memcached_st *tl_memc_h= memcached(test_literal_param("--server=localhost:9898 --server=localhost:9899")); 
  char *value= memcached_get(tl_memc_h, 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_MEMCACHED_ERRNO ( memcached_st * ) { const char * key = " " ; size_t len ; uint32_t flags ; memcached_return rc ; memcached_st * tl_memc_h = memcached ( test_literal_param ( " " ) ) ; char * value = memcached_get ( tl_memc_h , 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()
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 () but find that the server is not available .
// Create a handle. // This server should not exist // See if memcached is reachable.