rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
return 0;
char *key= "fig";
char *value= "we";
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
rc= memcached_flush(memc, 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_append(memc, key, strlen(key),
" the", strlen(" the"),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_append(memc, key, strlen(key),
" people", strlen(" people"),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
value= memcached_get(memc, key, strlen(key),
assert(!memcmp(value, "we the people", strlen("we the people")));
assert(strlen("we the people") == value_length);
assert(rc == MEMCACHED_SUCCESS);
+ free(value);
return 0;
}
unsigned int store_list[] = { 23, 56, 499, 98, 32847, 0 };
char *value;
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
unsigned int x;
rc= memcached_flush(memc, 0);
rc= memcached_set(memc,
key, strlen(key),
NULL, 0,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
for (x= 0; store_list[x] ; x++)
rc= memcached_append(memc,
key, strlen(key),
(char *)&store_list[x], sizeof(unsigned int),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
}
store_ptr= (unsigned int *)value;
x= 0;
- while (*store_ptr)
+ while ((size_t)store_ptr < (size_t)(value + value_length))
{
assert(*store_ptr == store_list[x++]);
store_ptr++;
}
+ free(value);
+
+ return 0;
+}
+
+uint8_t cas2_test(memcached_st *memc)
+{
+ memcached_return rc;
+ char *keys[]= {"fudge", "son", "food"};
+ size_t key_length[]= {5, 3, 4};
+ char *value= "we the people";
+ size_t value_length= strlen("we the people");
+ unsigned int x;
+ memcached_result_st results_obj;
+ memcached_result_st *results;
+ unsigned int set= 1;
+
+ rc= memcached_flush(memc, 0);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set);
+
+ for (x= 0; x < 3; x++)
+ {
+ rc= memcached_set(memc, keys[x], key_length[x],
+ keys[x], key_length[x],
+ (time_t)50, (uint32_t)9);
+ assert(rc == MEMCACHED_SUCCESS);
+ }
+
+ rc= memcached_mget(memc, keys, key_length, 3);
+
+ results= memcached_result_create(memc, &results_obj);
+
+ results= memcached_fetch_result(memc, &results_obj, &rc);
+ assert(results);
+ assert(results->cas);
+ assert(rc == MEMCACHED_SUCCESS);
+ WATCHPOINT_ASSERT(memcached_result_cas(results));
+
+ assert(!memcmp(value, "we the people", strlen("we the people")));
+ assert(strlen("we the people") == value_length);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ memcached_result_free(&results_obj);
return 0;
}
size_t value_length= strlen("we the people");
memcached_result_st results_obj;
memcached_result_st *results;
+ unsigned int set= 1;
rc= memcached_flush(memc, 0);
assert(rc == MEMCACHED_SUCCESS);
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set);
+
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_mget(memc, &key, &key_length, 1);
results= memcached_fetch_result(memc, &results_obj, &rc);
assert(results);
assert(rc == MEMCACHED_SUCCESS);
- WATCHPOINT_NUMBER(memcached_result_cas(results));
WATCHPOINT_ASSERT(memcached_result_cas(results));
assert(!memcmp(value, "we the people", strlen("we the people")));
char *key= "fig";
char *value= "people";
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
rc= memcached_flush(memc, 0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_prepend(memc, key, strlen(key),
"the ", strlen("the "),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_prepend(memc, key, strlen(key),
"we ", strlen("we "),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
value= memcached_get(memc, key, strlen(key),
assert(!memcmp(value, "we the people", strlen("we the people")));
assert(strlen("we the people") == value_length);
assert(rc == MEMCACHED_SUCCESS);
+ free(value);
return 0;
}
+/*
+ Set the value, then quit to make sure it is flushed.
+ Come back in and test that add fails.
+*/
uint8_t add_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
char *value= "when we sanitize";
+ rc= memcached_set(memc, key, strlen(key),
+ value, strlen(value),
+ (time_t)0, (uint32_t)0);
+ assert(rc == MEMCACHED_SUCCESS);
+ memcached_quit(memc);
rc= memcached_add(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_NOTSTORED);
return 0;
}
+uint8_t add_wrapper(memcached_st *memc)
+{
+ unsigned int x;
+
+ for (x= 0; x < 10000; x++)
+ add_test(memc);
+
+ return 0;
+}
+
uint8_t replace_test(memcached_st *memc)
{
memcached_return rc;
rc= memcached_replace(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
return 0;
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_delete(memc, key, strlen(key), (time_t)0);
char *key= "foo";
char *string;
size_t string_length;
- uint16_t flags;
+ uint32_t flags;
rc= memcached_delete(memc, key, strlen(key), (time_t)0);
assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_NOTFOUND);
char *value= "when we sanitize";
char *string;
size_t string_length;
- uint16_t flags;
+ uint32_t flags;
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
string= memcached_get(memc, key, strlen(key),
{
rc= memcached_set(memc, key, strlen(key),
value, value_length,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
}
{
rc= memcached_set(memc, key, strlen(key),
value, value_length,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
}
size_t value_length= 8191;
char *string;
size_t string_length;
- uint16_t flags;
+ uint32_t flags;
int x;
value = (char*)malloc(value_length);
rc= memcached_set(memc, key, strlen(key),
value, value_length,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
string= memcached_get(memc, key, strlen(key),
size_t value_length= 8191;
char *string;
size_t string_length;
- uint16_t flags;
+ uint32_t flags;
int x;
value = (char*)malloc(value_length);
rc= memcached_set(memc, key, strlen(key),
value, value_length,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
for (x= 0; x < 10; x++)
return 0;
}
+/* Do not copy the style of this code, I just access hosts to testthis function */
uint8_t stats_servername_test(memcached_st *memc)
{
memcached_return rc;
memcached_stat_st stat;
rc= memcached_stat_servername(&stat, NULL,
- "localhost",
- MEMCACHED_DEFAULT_PORT);
+ memc->hosts[0].hostname,
+ memc->hosts[0].port);
return 0;
}
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_increment(memc, key, strlen(key),
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
rc= memcached_decrement(memc, key, strlen(key),
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)10, (uint16_t)3);
+ (time_t)10, (uint32_t)3);
assert(rc == MEMCACHED_SUCCESS);
memcached_quit(memc);
rc= memcached_set(memc, key, strlen(key),
value, strlen(value),
- (time_t)50, (uint16_t)9);
+ (time_t)50, (uint32_t)9);
assert(rc == MEMCACHED_SUCCESS);
return 0;
{
assert(results);
}
+
while ((results= memcached_fetch_result(memc, &results_obj, &rc)) != NULL)
assert(!results);
- assert(rc == MEMCACHED_NOTFOUND);
+ assert(rc == MEMCACHED_END);
for (x= 0; x < 3; x++)
{
rc= memcached_set(memc, keys[x], key_length[x],
keys[x], key_length[x],
- (time_t)50, (uint16_t)9);
+ (time_t)50, (uint32_t)9);
assert(rc == MEMCACHED_SUCCESS);
}
assert(results);
}
assert(!results);
- assert(rc == MEMCACHED_NOTFOUND);
+ assert(rc == MEMCACHED_END);
for (x= 0; x < 3; x++)
{
rc= memcached_set(memc, keys[x], key_length[x],
keys[x], key_length[x],
- (time_t)50, (uint16_t)9);
+ (time_t)50, (uint32_t)9);
assert(rc == MEMCACHED_SUCCESS);
}
char *keys[]= {"fudge", "son", "food"};
size_t key_length[]= {5, 3, 4};
unsigned int x;
- uint16_t flags;
+ uint32_t flags;
char return_key[MEMCACHED_MAX_KEY];
size_t return_key_length;
}
assert(!return_value);
assert(return_value_length == 0);
- assert(rc == MEMCACHED_NOTFOUND);
+ assert(rc == MEMCACHED_END);
for (x= 0; x < 3; x++)
{
rc= memcached_set(memc, keys[x], key_length[x],
keys[x], key_length[x],
- (time_t)50, (uint16_t)9);
+ (time_t)50, (uint32_t)9);
assert(rc == MEMCACHED_SUCCESS);
}
for (x= 0; x < memcached_server_count(memc); x++)
{
- list= memcached_stat_get_keys(memc, &stat[x], &rc);
+ list= memcached_stat_get_keys(memc, stat+x, &rc);
assert(rc == MEMCACHED_SUCCESS);
- for (ptr= list; *ptr; ptr++)
- printf("Found key %s\n", *ptr);
+ for (ptr= list; *ptr; ptr++);
free(list);
}
{
memcached_return rc= MEMCACHED_SUCCESS;
char buffer[SMALL_STRING_LEN];
- uint16_t flags= 0;
+ uint32_t flags= 0;
size_t val_len= 0;
char *getval;
size_t return_key_length;
char *return_value;
size_t return_value_length;
- uint16_t flags;
+ uint32_t flags;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
char *keys[]= {"fudge", "son", "food"};
size_t key_length[]= {5, 3, 4};
unsigned int x;
- uint16_t flags;
+ uint32_t flags;
/* Here we free everything before running a bunch of mget tests */
{
{
rc= memcached_set(memc, keys[x], key_length[x],
keys[x], key_length[x],
- (time_t)50, (uint16_t)9);
+ (time_t)50, (uint32_t)9);
assert(rc == MEMCACHED_NO_SERVERS);
}
size_t return_key_length;
char *value;
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
unsigned int count;
unsigned int x;
char insert_data[VALUE_SIZE_BUG5];
{
rc= memcached_set(memc, keys[x], key_length[x],
insert_data, VALUE_SIZE_BUG5,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
}
size_t return_key_length;
char *value;
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
unsigned int count;
unsigned int x;
char insert_data[VALUE_SIZE_BUG5];
value= memcached_get(memc, keys[0], key_length[0],
&value_length, &flags, &rc);
assert(value == NULL);
+ assert(rc == MEMCACHED_NOTFOUND);
rc= memcached_mget(memc, keys, key_length, 4);
+ assert(rc == MEMCACHED_SUCCESS);
count= 0;
while ((value= memcached_fetch(memc, return_key, &return_key_length,
&value_length, &flags, &rc)))
count++;
assert(count == 0);
+ assert(rc == MEMCACHED_END);
for (x= 0; x < 4; x++)
{
rc= memcached_set(memc, keys[x], key_length[x],
insert_data, VALUE_SIZE_BUG5,
- (time_t)0, (uint16_t)0);
+ (time_t)0, (uint32_t)0);
assert(rc == MEMCACHED_SUCCESS);
}
- for (x= 0; x < 10; x++)
+ for (x= 0; x < 2; x++)
{
value= memcached_get(memc, keys[0], key_length[0],
&value_length, &flags, &rc);
free(value);
rc= memcached_mget(memc, keys, key_length, 4);
+ assert(rc == MEMCACHED_SUCCESS);
count= 3;
/* We test for purge of partial complete fetches */
for (count= 3; count; count--)
{
value= memcached_fetch(memc, return_key, &return_key_length,
&value_length, &flags, &rc);
- free(value);
assert(rc == MEMCACHED_SUCCESS);
+ assert(!(memcmp(value, insert_data, value_length)));
+ assert(value_length);
+ free(value);
}
}
return 0;
}
+uint8_t user_supplied_bug8(memcached_st *memc)
+{
+ memcached_return rc;
+ memcached_st *mine;
+ memcached_st *clone;
+
+ memcached_server_st *servers;
+ char *server_list= "memcache1.memcache.bk.sapo.pt:11211, memcache1.memcache.bk.sapo.pt:11212, memcache1.memcache.bk.sapo.pt:11213, memcache1.memcache.bk.sapo.pt:11214, memcache2.memcache.bk.sapo.pt:11211, memcache2.memcache.bk.sapo.pt:11212, memcache2.memcache.bk.sapo.pt:11213, memcache2.memcache.bk.sapo.pt:11214";
+
+ servers= memcached_servers_parse(server_list);
+ assert(servers);
+
+ mine= memcached_create(NULL);
+ rc= memcached_server_push(mine, servers);
+ assert(rc == MEMCACHED_SUCCESS);
+ memcached_server_list_free(servers);
+
+ assert(mine);
+ clone= memcached_clone(NULL, mine);
+
+ memcached_quit(mine);
+ memcached_quit(clone);
+
+
+ memcached_free(mine);
+ memcached_free(clone);
+
+ return 0;
+}
+
/* Test flag store/retrieve */
uint8_t user_supplied_bug7(memcached_st *memc)
{
size_t return_key_length;
char *value;
size_t value_length;
- uint16_t flags;
+ uint32_t flags;
unsigned int x;
char insert_data[VALUE_SIZE_BUG5];
return 0;
}
+uint8_t user_supplied_bug9(memcached_st *memc)
+{
+ memcached_return rc;
+ char *keys[]= {"UDATA:edevil@sapo.pt", "fudge&*@#", "for^#@&$not"};
+ size_t key_length[3];
+ unsigned int x;
+ uint32_t flags;
+ unsigned count= 0;
+
+ char return_key[MEMCACHED_MAX_KEY];
+ size_t return_key_length;
+ char *return_value;
+ size_t return_value_length;
+
+
+ key_length[0]= strlen("UDATA:edevil@sapo.pt");
+ key_length[1]= strlen("fudge&*@#");
+ key_length[2]= strlen("for^#@&$not");
+
+
+ for (x= 0; x < 3; x++)
+ {
+ rc= memcached_set(memc, keys[x], key_length[x],
+ keys[x], key_length[x],
+ (time_t)50, (uint32_t)9);
+ assert(rc == MEMCACHED_SUCCESS);
+ }
+
+ rc= memcached_mget(memc, keys, key_length, 3);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ /* We need to empty the server before continueing test */
+ while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
+ &return_value_length, &flags, &rc)) != NULL)
+ {
+ assert(return_value);
+ free(return_value);
+ count++;
+ }
+ assert(count == 3);
+
+ return 0;
+}
+
+/* We are testing with aggressive timeout to get failures */
+uint8_t user_supplied_bug10(memcached_st *memc)
+{
+ char *key= "foo";
+ char *value;
+ size_t value_length= 512;
+ unsigned int x;
+ int key_len= 3;
+ memcached_return rc;
+ unsigned int set= 1;
+ memcached_st *mclone= memcached_clone(NULL, memc);
+ int32_t timeout;
+
+ memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, &set);
+ memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, &set);
+ timeout= 2;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout);
+
+ value = (char*)malloc(value_length * sizeof(char));
+
+ for (x= 0; x < value_length; x++)
+ value[x]= (char) (x % 127);
+
+ for (x= 1; x <= 100000; ++x)
+ {
+ rc= memcached_set(mclone, key, key_len,value, value_length, 0, 0);
+
+ assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_WRITE_FAILURE);
+
+ if (rc == MEMCACHED_WRITE_FAILURE)
+ x--;
+ }
+
+ free(value);
+ memcached_free(mclone);
+
+ return 0;
+}
+
+/*
+ We are looking failures in the async protocol
+*/
+uint8_t user_supplied_bug11(memcached_st *memc)
+{
+ char *key= "foo";
+ char *value;
+ size_t value_length= 512;
+ unsigned int x;
+ int key_len= 3;
+ memcached_return rc;
+ unsigned int set= 1;
+ int32_t timeout;
+ 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);
+ timeout= -1;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout);
+
+ timeout= (int32_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
+
+ assert(timeout == -1);
+
+ value = (char*)malloc(value_length * sizeof(char));
+
+ for (x= 0; x < value_length; x++)
+ value[x]= (char) (x % 127);
+
+ for (x= 1; x <= 100000; ++x)
+ {
+ rc= memcached_set(mclone, key, key_len,value, value_length, 0, 0);
+
+ WATCHPOINT_IFERROR(rc);
+ //assert(rc == MEMCACHED_SUCCESS);
+ }
+
+ free(value);
+ memcached_free(mclone);
+
+ return 0;
+}
+
uint8_t result_static(memcached_st *memc)
{
memcached_result_st result;
return 0;
}
+uint8_t cleanup_pairs(memcached_st *memc)
+{
+ pairs_free(global_pairs);
+
+ return 0;
+}
+
uint8_t generate_data(memcached_st *memc)
{
unsigned long long x;
{
char *return_value;
size_t return_value_length;
- uint16_t flags;
+ uint32_t flags;
for (x= 0; x < GLOBAL_COUNT; x++)
{
size_t return_key_length;
char *return_value;
size_t return_value_length;
- uint16_t flags;
+ uint32_t flags;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
return MEMCACHED_SUCCESS;
}
+memcached_return pre_hsieh(memcached_st *memc)
+{
+ memcached_hash value= MEMCACHED_HASH_HSIEH;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, &value);
+
+ return MEMCACHED_SUCCESS;
+}
+
memcached_return pre_hash_fnv1_64(memcached_st *memc)
{
memcached_hash value= MEMCACHED_HASH_FNV1_64;
return MEMCACHED_SUCCESS;
}
+memcached_return enable_consistent(memcached_st *memc)
+{
+ memcached_server_distribution value= MEMCACHED_DISTRIBUTION_CONSISTENT;
+ memcached_hash hash;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, &value);
+ pre_hsieh(memc);
+
+ value= (memcached_server_distribution)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
+ assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT);
+
+ hash= (memcached_hash)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
+ assert(hash == MEMCACHED_HASH_HSIEH);
+
+
+ return MEMCACHED_SUCCESS;
+}
+
+memcached_return enable_cas(memcached_st *memc)
+{
+ unsigned int set= 1;
+
+ memcached_version(memc);
+
+ if (memc->hosts[0].major_version >= 1 &&
+ memc->hosts[0].minor_version >= 2 &&
+ memc->hosts[0].micro_version >= 4)
+ {
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS, &set);
+
+ return MEMCACHED_SUCCESS;
+ }
+
+ return MEMCACHED_FAILURE;
+}
+
memcached_return check_for_1_2_3(memcached_st *memc)
{
memcached_version(memc);
return MEMCACHED_SUCCESS;
}
+memcached_return poll_timeout(memcached_st *memc)
+{
+ int32_t timeout;
+
+ timeout= 100;
+
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, &timeout);
+
+ timeout= (int32_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT);
+
+ assert(timeout == 100);
+
+ return MEMCACHED_SUCCESS;
+}
+
/* Clean the server before beginning testing */
test_st tests[] ={
{"set", 0, set_test },
{"set2", 0, set_test2 },
{"set3", 0, set_test3 },
- {"add", 0, add_test },
+ {"add", 1, add_test },
{"replace", 0, replace_test },
{"delete", 1, delete_test },
{"get", 1, get_test },
{0, 0, 0}
};
+test_st async_tests[] ={
+ {"add", 1, add_wrapper },
+ {0, 0, 0}
+};
+
test_st string_tests[] ={
{"string static with null", 0, string_static_null },
{"string alloc with null", 0, string_alloc_null },
test_st version_1_2_3[] ={
{"append", 0, append_test },
{"prepend", 0, prepend_test },
-// {"cas", 0, cas_test },
+ {"cas", 0, cas_test },
+ {"cas2", 0, cas2_test },
{"append_binary", 0, append_binary_test },
{0, 0, 0}
};
{"user_supplied_bug5", 1, user_supplied_bug5 },
{"user_supplied_bug6", 1, user_supplied_bug6 },
{"user_supplied_bug7", 1, user_supplied_bug7 },
+ {"user_supplied_bug8", 1, user_supplied_bug8 },
+ {"user_supplied_bug9", 1, user_supplied_bug9 },
+ {"user_supplied_bug10", 1, user_supplied_bug10 },
+ {"user_supplied_bug11", 1, user_supplied_bug11 },
{0, 0, 0}
};
{"get_read", 0, get_read },
{"mget_read", 0, mget_read },
{"mget_read_result", 0, mget_read_result },
+ {"cleanup", 0, cleanup_pairs },
{0, 0, 0}
};
{"nodelay", pre_nodelay, 0, tests},
{"md5", pre_md5, 0, tests},
{"crc", pre_crc, 0, tests},
+ {"hsieh", pre_hsieh, 0, tests},
{"fnv1_64", pre_hash_fnv1_64, 0, tests},
{"fnv1a_64", pre_hash_fnv1a_64, 0, tests},
{"fnv1_32", pre_hash_fnv1_32, 0, tests},
{"ketama", pre_hash_ketama, 0, tests},
{"unix_socket", pre_unix_socket, 0, tests},
{"unix_socket_nodelay", pre_nodelay, 0, tests},
+ {"poll_timeout", poll_timeout, 0, tests},
+ {"gets", enable_cas, 0, tests},
+ {"consistent", enable_consistent, 0, tests},
// {"udp", pre_udp, 0, tests},
{"version_1_2_3", check_for_1_2_3, 0, version_1_2_3},
{"string", 0, 0, string_tests},
{"result", 0, 0, result_tests},
+ {"async", pre_nonblock, 0, async_tests},
{"user", 0, 0, user_tests},
{"generate", 0, 0, generate_tests},
+ {"generate_hsieh", pre_hsieh, 0, generate_tests},
+ {"generate_hsieh_consistent", enable_consistent, 0, generate_tests},
+ {"generate_md5", pre_md5, 0, generate_tests},
{"generate_nonblock", pre_nonblock, 0, generate_tests},
{0, 0, 0, 0}
};