*/
#include "libmemcached/common.h"
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
return_value= memcached_get(memc, global_keys[test_bit], global_keys_length[test_bit],
&return_value_length, &flags, &rc);
if (rc == MEMCACHED_SUCCESS && return_value)
+ {
free(return_value);
+ }
else if (rc == MEMCACHED_NOTFOUND)
+ {
continue;
+ }
else
{
WATCHPOINT_ERROR(rc);
if (getenv("MEMCACHED_ATOM_BURIN_IN"))
goto infinite;
- return 0;
+ return TEST_SUCCESS;
}
-static memcached_return_t pre_nonblock(memcached_st *memc)
+static test_return_t pre_nonblock(memcached_st *memc)
{
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 0);
- return MEMCACHED_SUCCESS;
-}
-
-static memcached_return_t pre_md5(memcached_st *memc)
-{
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MD5);
-
- return MEMCACHED_SUCCESS;
-}
-
-static memcached_return_t pre_hsieh(memcached_st *memc)
-{
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_HSIEH);
-
- return MEMCACHED_SUCCESS;
-}
-
-static memcached_return_t enable_consistent(memcached_st *memc)
-{
- memcached_server_distribution_t value= MEMCACHED_DISTRIBUTION_CONSISTENT;
- memcached_hash_t hash;
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value);
- pre_hsieh(memc);
-
- value= (memcached_server_distribution_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
- assert(value == MEMCACHED_DISTRIBUTION_CONSISTENT);
-
- hash= (memcached_hash_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
- assert(hash == MEMCACHED_HASH_HSIEH);
-
-
- return MEMCACHED_SUCCESS;
+ return TEST_SUCCESS;
}
/*
collection_st collection[] ={
{"smash", 0, 0, smash_tests},
- {"smash_hsieh", (test_callback_fn)pre_hsieh, 0, smash_tests},
- {"smash_hsieh_consistent", (test_callback_fn)enable_consistent, 0, smash_tests},
- {"smash_md5", (test_callback_fn)pre_md5, 0, smash_tests},
{"smash_nonblock", (test_callback_fn)pre_nonblock, 0, smash_tests},
{0, 0, 0, 0}
};
MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
+PLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
+
ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
test-atom: tests/atomsmasher
$(ATOM_COMMAND)
+test-plus: tests/testplus
+ $(PLUS_COMMAND)
+
test-hash: tests/testhashkit
$(HASH_COMMAND)
gdb-atom: tests/atomsmasher
$(DEBUG_COMMAND) $(ATOM_COMMAND)
+gdb-plus: tests/testplus
+ $(DEBUG_COMMAND) $(PLUS_COMMAND)
+
gdb-hash: tests/testhashkit
$(DEBUG_COMMAND) $(HASH_COMMAND)
valgrind-atom: tests/atomsmasher
$(VALGRIND_COMMAND) $(ATOM_COMMAND)
+valgrind-plus: tests/testplus
+ $(VALGRIND_COMMAND) $(PLUS_COMMAND)
+
valgrind-hash: tests/testhashkit
$(VALGRIND_COMMAND) $(HASH_COMMAND)