summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorContinuous Integration <ci@tangent.org>2013-10-11 03:57:29 -0700
committerContinuous Integration <ci@tangent.org>2013-10-11 03:57:29 -0700
commit95bb4cd1ce48756ca12e5cc1bb6bd6ff8f457908 (patch)
treedade34abef2ef8041de9e53ac78993830a251e36 /tests
parent0e40facad567ea11474b62f597c34faeea5c86fe (diff)
parent68f3c1df6d39eb2e507e32e18632f545dc2e923f (diff)
downloadlibmemcached-95bb4cd1ce48756ca12e5cc1bb6bd6ff8f457908.tar.gz
Merge lp:~brianaker/libmemcached/key-cleanup/ Build: jenkins-Libmemcached-369
Diffstat (limited to 'tests')
-rw-r--r--tests/cli.am9
-rw-r--r--tests/libmemcached-1.0/mem_functions.cc20
-rw-r--r--tests/libmemcached_world.h2
-rw-r--r--tests/libmemcached_world_socket.h3
-rw-r--r--tests/memdump.cc16
5 files changed, 27 insertions, 23 deletions
diff --git a/tests/cli.am b/tests/cli.am
index df206e5c..1bb9a6a9 100644
--- a/tests/cli.am
+++ b/tests/cli.am
@@ -122,3 +122,12 @@ valgrind-memerror: tests/memerror
valgrind-memtouch: tests/memtouch
@$(VALGRIND_COMMAND) tests/memtouch
+
+test-memdump: tests/memdump
+ tests/memdump
+
+gdb-memdump: tests/memdump
+ @$(GDB_COMMAND) tests/memdump
+
+valgrind-memdump: tests/memdump
+ @$(VALGRIND_COMMAND) tests/memdump
diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc
index 6e6f4a7b..a6c38c5b 100644
--- a/tests/libmemcached-1.0/mem_functions.cc
+++ b/tests/libmemcached-1.0/mem_functions.cc
@@ -993,6 +993,7 @@ test_return_t bad_key_test(memcached_st *memc)
test_compare(MEMCACHED_SUCCESS,
memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, true));
test_compare(query_id, memcached_query_id(memc_clone)); // We should not increase the query_id for memcached_behavior_set()
+ ASSERT_TRUE(memcached_behavior_get(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY));
/* All keys are valid in the binary protocol (except for length) */
if (memcached_behavior_get(memc_clone, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) == false)
@@ -3081,7 +3082,7 @@ test_return_t selection_of_namespace_tests(memcached_st *memc)
const char *key= "mine";
char *value;
- /* Make sure be default none exists */
+ /* Make sure by default none exists */
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_null(value);
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
@@ -3092,7 +3093,7 @@ test_return_t selection_of_namespace_tests(memcached_st *memc)
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_true(value);
- test_memcmp(value, key, 4);
+ test_memcmp(value, key, strlen(key));
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
/* Test that we can turn it off */
@@ -3110,7 +3111,7 @@ test_return_t selection_of_namespace_tests(memcached_st *memc)
value= (char *)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_true(value);
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
- test_memcmp(value, key, 4);
+ test_memcmp(value, key, strlen(key));
/* Set to Zero, and then Set to something too large */
{
@@ -3120,9 +3121,7 @@ test_return_t selection_of_namespace_tests(memcached_st *memc)
test_compare(MEMCACHED_SUCCESS,
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, NULL));
- value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_null(value);
- test_compare(MEMCACHED_SUCCESS, rc);
+ ASSERT_NULL_(memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc), "Setting namespace to NULL did not work");
/* Test a long key for failure */
/* TODO, extend test to determine based on setting, what result should be */
@@ -3150,11 +3149,10 @@ test_return_t set_namespace(memcached_st *memc)
{
memcached_return_t rc;
const char *key= "mine";
- char *value;
// Make sure we default to a null namespace
- value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_null(value);
+ char* value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
+ ASSERT_NULL_(value, "memc had a value for namespace when none should exist");
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
/* Test a clean set */
@@ -3162,8 +3160,8 @@ test_return_t set_namespace(memcached_st *memc)
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, (void *)key));
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_true(value);
- test_memcmp(value, key, 4);
+ ASSERT_TRUE(value);
+ test_memcmp(value, key, strlen(key));
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
return TEST_SUCCESS;
diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h
index 6bed25a9..4d4953ee 100644
--- a/tests/libmemcached_world.h
+++ b/tests/libmemcached_world.h
@@ -87,12 +87,14 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er
static bool world_destroy(void *object)
{
libmemcached_test_container_st *container= (libmemcached_test_container_st *)object;
+#if 0
#if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT
if (LIBMEMCACHED_WITH_SASL_SUPPORT)
{
sasl_done();
}
#endif
+#endif
delete container;
diff --git a/tests/libmemcached_world_socket.h b/tests/libmemcached_world_socket.h
index 64cf55e5..69f0a91b 100644
--- a/tests/libmemcached_world_socket.h
+++ b/tests/libmemcached_world_socket.h
@@ -75,12 +75,15 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er
static bool world_destroy(void *object)
{
libmemcached_test_container_st *container= (libmemcached_test_container_st *)object;
+
+#if 0
#if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT
if (LIBMEMCACHED_WITH_SASL_SUPPORT)
{
sasl_done();
}
#endif
+#endif
delete container;
diff --git a/tests/memdump.cc b/tests/memdump.cc
index 2a502371..ab59c3ce 100644
--- a/tests/memdump.cc
+++ b/tests/memdump.cc
@@ -111,19 +111,11 @@ collection_st collection[] ={
{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(), NULL) == false)
- {
- error= TEST_FAILURE;
- return NULL;
- }
+ SKIP_UNLESS(libtest::has_memcached());
+
+ ASSERT_TRUE(server_startup(servers, "memcached", libtest::default_port(), NULL));
return &servers;
}