value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS);
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, value + 1);
test_truth((value + 1) == memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS));
+
return TEST_SUCCESS;
}
return rc == MEMCACHED_SUCCESS ? TEST_SUCCESS : TEST_SKIPPED;
}
+
static test_return_t pre_replication(memcached_st *memc)
{
test_return_t test_rc;
return rc == MEMCACHED_SUCCESS ? TEST_SUCCESS : TEST_SKIPPED;
}
+
static test_return_t pre_replication_noblock(memcached_st *memc)
{
- test_return_t rc= MEMCACHED_FAILURE;
- if (pre_replication(memc) == TEST_SUCCESS &&
- pre_nonblock(memc) == TEST_SUCCESS)
- rc= TEST_SUCCESS;
+ test_return_t rc;
+
+ rc= pre_replication(memc);
+ if (rc != TEST_SUCCESS)
+ return rc;
+
+ rc= pre_nonblock(memc);
return rc;
}
+
static void my_free(memcached_st *ptr __attribute__((unused)), void *mem)
{
#ifdef HARD_MALLOC_TESTS
#endif
}
+
static void *my_malloc(memcached_st *ptr __attribute__((unused)), const size_t size)
{
#ifdef HARD_MALLOC_TESTS
return ret;
}
+
static void *my_realloc(memcached_st *ptr __attribute__((unused)), void *mem, const size_t size)
{
#ifdef HARD_MALLOC_TESTS
#endif
}
+
static void *my_calloc(memcached_st *ptr __attribute__((unused)), size_t nelem, const size_t size)
{
#ifdef HARD_MALLOC_TESTS
#endif
}
+
static test_return_t set_prefix(memcached_st *memc)
{
memcached_return_t rc;
return TEST_SUCCESS;
}
+
#ifdef MEMCACHED_ENABLE_DEPRECATED
static test_return_t deprecated_set_memory_alloc(memcached_st *memc)
{
}
#endif
+
static test_return_t set_memory_alloc(memcached_st *memc)
{
memcached_return_t rc;
{"clone_test", 0, (test_callback_fn)clone_test },
{"connection_test", 0, (test_callback_fn)connection_test},
{"callback_test", 0, (test_callback_fn)callback_test},
- {"behavior_test", 0, (test_callback_fn)behavior_test},
{"userdata_test", 0, (test_callback_fn)userdata_test},
{"error", 0, (test_callback_fn)error_test },
{"set", 0, (test_callback_fn)set_test },
{"add_host_test", 0, (test_callback_fn)add_host_test },
{"add_host_test_1", 0, (test_callback_fn)add_host_test1 },
{"get_stats_keys", 0, (test_callback_fn)get_stats_keys },
- {"behavior_test", 0, (test_callback_fn)get_stats_keys },
- {"callback_test", 0, (test_callback_fn)get_stats_keys },
{"version_string_test", 0, (test_callback_fn)version_string_test},
{"bad_key", 1, (test_callback_fn)bad_key_test },
{"memcached_server_cursor", 1, (test_callback_fn)memcached_server_cursor_test },
{0, 0, 0}
};
+test_st behavior_tests[] ={
+ {"behavior_test", 0, (test_callback_fn)behavior_test},
+ {0, 0, 0}
+};
+
test_st async_tests[] ={
{"add", 1, (test_callback_fn)add_wrapper },
{0, 0, 0}
{"replication", (test_callback_fn)pre_replication, 0, replication_tests},
{"replication_noblock", (test_callback_fn)pre_replication_noblock, 0, replication_tests},
{"regression", 0, 0, regression_tests},
+ {"behaviors", 0, 0, behavior_tests},
{0, 0, 0, 0}
};