static test_return_t cat_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
const char *args[]= { buffer, "foo", 0 };
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_compare(MEMCACHED_SUCCESS,
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
test_compare(MEMCACHED_SUCCESS, rc);
+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
static test_return_t NOT_FOUND_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
const char *args[]= { buffer, "foo", 0 };
- memcached_st *memc= memcached(buffer, strlen(buffer));
- test_true(memc);
+ memcached_st *memc= memcached(buffer, length);
+ ASSERT_TRUE(memc);
test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
test_compare(MEMCACHED_NOTFOUND, rc);
+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
static test_return_t FOUND_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
const char *args[]= { buffer, 0 };
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_compare(MEMCACHED_SUCCESS,
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
test_compare(MEMCACHED_SUCCESS, rc);
+ length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE);
memcached_free(memc);
static test_return_t exist_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
const char *args[]= { buffer, "foo", 0 };
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_compare(MEMCACHED_SUCCESS,
static test_return_t NOT_FOUND_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
const char *args[]= { buffer, "foo", 0 };
- memcached_st *memc= memcached(buffer, strlen(buffer));
- test_true(memc);
+ memcached_st *memc= memcached(buffer, length);
+ ASSERT_TRUE(memc);
test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
static test_return_t check_version(void*)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
- memcached_st *memc= memcached(buffer, strlen(buffer));
- test_true(memc);
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ memcached_st *memc= memcached(buffer, length);
+ ASSERT_TRUE(memc);
test_return_t result= TEST_SUCCESS;
if (libmemcached_util_version_check(memc, 1, 4, 8) == false)
static test_return_t ping_TEST(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
const char *args[]= { buffer, 0 };
test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
static test_return_t NOT_FOUND_TEST(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=nonexist.libmemcached.org:%d", int(default_port()));
+ snprintf(buffer, sizeof(buffer), "--servers=nonexist.libmemcached.org:%d", int(default_port()));
const char *args[]= { buffer, 0 };
test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
test_compare(MEMCACHED_SUCCESS, rc);
+ char memrm_buffer[1024];
+ snprintf(memrm_buffer, sizeof(memrm_buffer), "--servers=localhost:%d", int(default_port()));
const char *args[]= { buffer, "foo", 0 };
test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
static test_return_t multiple_NOT_FOUND_TEST(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
const char *args[]= { buffer, "protocols", "foo", "mine", "bar", "dog", "cat", "foo", "mine",
"eye", "for", "the", "to", "not", "know", "what", "I", "should", "be", "doing", 0 };
static test_return_t touch_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_compare(MEMCACHED_SUCCESS,
static test_return_t NOT_FOUND_test(void *)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo")));
- snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
+ length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
const char *args[]= { "--expire=30", buffer, "foo", 0 };
test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
static test_return_t check_version(void*)
{
char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
- memcached_st *memc= memcached(buffer, strlen(buffer));
+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
+ memcached_st *memc= memcached(buffer, length);
test_true(memc);
test_return_t result= TEST_SUCCESS;