X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fmemtouch.cc;h=a09bd40a0c8a8eaf92dbcf14f45d36f24560ecb8;hb=1267d56c788cf8628c4111042d01b926f4a58dba;hp=426e3c981d88c0ae650539f6f71aec0ed08f34bb;hpb=64e9fa38f42f0d30463da5ddc3a573619941d93a;p=m6w6%2Flibmemcached diff --git a/tests/memtouch.cc b/tests/memtouch.cc index 426e3c98..a09bd40a 100644 --- a/tests/memtouch.cc +++ b/tests/memtouch.cc @@ -65,7 +65,6 @@ static test_return_t touch_test(void *) { char buffer[1024]; snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); - const char *args[]= { "--expire=30", buffer, "foo", 0 }; memcached_st *memc= memcached(buffer, strlen(buffer)); test_true(memc); @@ -75,6 +74,8 @@ static test_return_t touch_test(void *) test_compare(MEMCACHED_SUCCESS, memcached_exist(memc, test_literal_param("foo"))); + snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); + const char *args[]= { "--expire=30", buffer, "foo", 0 }; test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); test_compare(MEMCACHED_SUCCESS, memcached_exist(memc, test_literal_param("foo"))); @@ -87,9 +88,8 @@ static test_return_t touch_test(void *) static test_return_t NOT_FOUND_test(void *) { char buffer[1024]; - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); - const char *args[]= { "--expire=30", buffer, "foo", 0 }; + snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); memcached_st *memc= memcached(buffer, strlen(buffer)); test_true(memc); @@ -97,6 +97,8 @@ static test_return_t NOT_FOUND_test(void *) test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo"))); + 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)); test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo")));