projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
travis: sasl
[m6w6/libmemcached]
/
tests
/
memdump.cc
diff --git
a/tests/memdump.cc
b/tests/memdump.cc
index d702ef6a50983efad4f1cc59af3f187f4e06773a..0ad421f14b3310d179d763eddee12ba56203fc18 100644
(file)
--- a/
tests/memdump.cc
+++ b/
tests/memdump.cc
@@
-39,10
+39,10
@@
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
"libtest/test.hpp"
+#include
"libmemcached-1.0/memcached.h"
using namespace libtest;
using namespace libtest;
@@
-50,7
+50,7
@@
using namespace libtest;
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
-static std::string executable("./
clients
/memdump");
+static std::string executable("./
src/bin
/memdump");
static test_return_t help_test(void *)
{
static test_return_t help_test(void *)
{
@@
-75,10
+75,10
@@
static test_return_t server_test(void *)
static test_return_t FOUND_test(void *)
{
char buffer[1024];
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 };
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_true(memc);
test_compare(MEMCACHED_SUCCESS,
@@
-91,6
+91,7
@@
static test_return_t FOUND_test(void *)
test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
test_compare(MEMCACHED_SUCCESS, rc);
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);
test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE);
memcached_free(memc);
@@
-110,19
+111,11
@@
collection_st collection[] ={
{0, 0, 0, 0}
};
{0, 0, 0, 0}
};
-static void *world_create(server_startup_st& servers, test_return_t&
error
)
+static void *world_create(server_startup_st& servers, test_return_t&)
{
{
- if (libtest::has_memcached() == false)
- {
- error= TEST_SKIPPED;
- return NULL;
- }
-
- if (server_startup(servers, "memcached", libtest::default_port(), 0, NULL) == false)
- {
- error= TEST_FAILURE;
- return NULL;
- }
+ SKIP_UNLESS(libtest::has_memcached());
+
+ ASSERT_TRUE(server_startup(servers, "memcached", libtest::default_port(), NULL));
return &servers;
}
return &servers;
}