tests/mem_functions.cc
/*
  We are looking failures in the async protocol
*/
We are looking failures in the async protocol
We are looking failures in the async protocol
static test_return_t user_supplied_bug11(memcached_st *memc)
{
  const char *key= "foo";
  size_t value_length= 512;
  size_t key_len= 3;
  unsigned int set= 1;
  memcached_st *mclone= memcached_clone(NULL, memc);
  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, set);
  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, set);
  int32_t timeout= -1;
  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, (size_t)timeout);
  timeout= (int32_t)memcached_behavior_get(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
  test_true(timeout == -1);
  char *value= (char*)malloc(value_length * sizeof(char));
  for (unsigned int x= 0; x < value_length; x++)
  {
    value[x]= (char) (x % 127);
  }
  for (unsigned int x= 1; x <= 100000; ++x)
  {
    memcached_return_t rc= memcached_set(mclone, key, key_len,value, value_length, 0, 0);
    (void)rc;
  }
  free(value);
  memcached_free(mclone);
  return TEST_SUCCESS;
}
static test_return_t user_supplied_bug11 ( memcached_st * memc ) { const char * key = " " ; size_t value_length = 512 ; size_t key_len = 3 ; unsigned int set = 1 ; memcached_st * mclone = memcached_clone ( NULL , memc ) ; memcached_behavior_set ( mclone , MEMCACHED_BEHAVIOR_NO_BLOCK , set ) ; memcached_behavior_set ( mclone , MEMCACHED_BEHAVIOR_TCP_NODELAY , set ) ; int32_t timeout = -1 ; memcached_behavior_set ( mclone , MEMCACHED_BEHAVIOR_POLL_TIMEOUT , ( size_t ) timeout ) ; timeout = ( int32_t ) memcached_behavior_get ( mclone , MEMCACHED_BEHAVIOR_POLL_TIMEOUT ) ; test_true ( timeout == -1 ) ; char * value = ( char * ) malloc ( value_length * sizeof ( char ) ) ; for ( unsigned int x = 0 ; x < value_length ; x ++ ) { value [ x ] = ( char ) ( x % 127 ) ; } for ( unsigned int x = 1 ; x <= 100000 ; ++ x ) { memcached_return_t rc = memcached_set ( mclone , key , key_len , value , value_length , 0 , 0 ) ; ( void ) rc ; } free ( value ) ; memcached_free ( mclone ) ; return TEST_SUCCESS ; }
We are looking failures in the async protocol
We are looking failures in the async protocol