projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
libmemcached: fix ub; TODO: what's that watchpoint.h stuff?
[m6w6/libmemcached]
/
tests
/
memtouch.cc
diff --git
a/tests/memtouch.cc
b/tests/memtouch.cc
index 5617fa2895683fc5d11143ad2f320af07c08f94f..f2d9a80c739d1938ce81bf635d6ac1be9a0fcd63 100644
(file)
--- a/
tests/memtouch.cc
+++ b/
tests/memtouch.cc
@@
-39,11
+39,11
@@
Test that we are cycling the servers we are creating during testing.
*/
Test that we are cycling the servers we are creating during testing.
*/
-#include
<mem_config.h>
+#include
"mem_config.h"
-#include
<libtest/test.hpp>
-#include
<libmemcached-1.0/memcached.h>
-#include
<libmemcachedutil-1.0/util.h>
+#include
"libtest/test.hpp"
+#include
"libmemcached-1.0/memcached.h"
+#include
"libmemcachedutil-1.0/util.h"
using namespace libtest;
using namespace libtest;
@@
-65,9
+65,9
@@
static test_return_t help_test(void *)
static test_return_t touch_test(void *)
{
char buffer[1024];
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,
test_true(memc);
test_compare(MEMCACHED_SUCCESS,
@@
-89,15
+89,15
@@
static test_return_t touch_test(void *)
static test_return_t NOT_FOUND_test(void *)
{
char buffer[1024];
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")));
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));
const char *args[]= { "--expire=30", buffer, "foo", 0 };
test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
@@
-111,8
+111,8
@@
static test_return_t NOT_FOUND_test(void *)
static test_return_t check_version(void*)
{
char buffer[1024];
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;
test_true(memc);
test_return_t result= TEST_SUCCESS;
@@
-156,7
+156,7
@@
static void *world_create(server_startup_st& servers, test_return_t& error)
void get_world(libtest::Framework* world)
{
void get_world(libtest::Framework* world)
{
- executable= "./
clients
/memtouch";
+ executable= "./
src/bin
/memtouch";
world->collections(collection);
world->create(world_create);
}
world->collections(collection);
world->create(world_create);
}