summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Aker <brian@tangent.org>2013-06-12 00:11:22 -0700
committerBrian Aker <brian@tangent.org>2013-06-12 00:11:22 -0700
commit564d0ca1655236d1b8aeb8b271532e2b065a3ff8 (patch)
tree5a6692e86eff6243c6536ee60fde0c77586ca078 /tests
parent26b72ba3ad4ad34cde00a5cd87febcbaa093470d (diff)
downloadlibmemcached-564d0ca1655236d1b8aeb8b271532e2b065a3ff8.tar.gz
Fix compile issues and version number (which has to be a number).
Diffstat (limited to 'tests')
-rw-r--r--tests/keys.hpp3
-rw-r--r--tests/libmemcached-1.0/all_tests.cc2
-rw-r--r--tests/libmemcached-1.0/generate.cc3
-rw-r--r--tests/libmemcached-1.0/pool.cc5
-rw-r--r--tests/libmemcached-1.0/sasl.cc35
-rw-r--r--tests/libmemcached_world.h2
-rw-r--r--tests/memcp.cc2
7 files changed, 27 insertions, 25 deletions
diff --git a/tests/keys.hpp b/tests/keys.hpp
index 1034a672..99ced4ab 100644
--- a/tests/keys.hpp
+++ b/tests/keys.hpp
@@ -39,6 +39,8 @@
#include <uuid/uuid.h>
#endif
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunreachable-code"
struct keys_st {
public:
keys_st(size_t arg)
@@ -143,3 +145,4 @@ private:
libtest::vchar_ptr_t _keys;
std::vector<size_t> _lengths;
};
+#pragma GCC diagnostic pop
diff --git a/tests/libmemcached-1.0/all_tests.cc b/tests/libmemcached-1.0/all_tests.cc
index a471d89a..045c426e 100644
--- a/tests/libmemcached-1.0/all_tests.cc
+++ b/tests/libmemcached-1.0/all_tests.cc
@@ -83,7 +83,7 @@ void get_world(libtest::Framework* world)
{
// Assume a minimum of 3, and a maximum of 8
world->servers().set_servers_to_run((libtest::number_of_cpus() > 3) ?
- std::min(libtest::number_of_cpus(), size_t(8)) : 3);
+ std::min(libtest::number_of_cpus(), uint32_t(8)) : 3);
}
world->collections(collection);
diff --git a/tests/libmemcached-1.0/generate.cc b/tests/libmemcached-1.0/generate.cc
index a0d19c49..39e5d9fe 100644
--- a/tests/libmemcached-1.0/generate.cc
+++ b/tests/libmemcached-1.0/generate.cc
@@ -113,6 +113,8 @@ test_return_t generate_data(memcached_st *memc)
return TEST_SUCCESS;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunreachable-code"
test_return_t generate_data_with_stats(memcached_st *memc)
{
test_compare(TEST_SUCCESS, generate_pairs(memc));
@@ -147,6 +149,7 @@ test_return_t generate_data_with_stats(memcached_st *memc)
return TEST_SUCCESS;
}
+#pragma GCC diagnostic pop
test_return_t generate_buffer_data(memcached_st *memc)
{
diff --git a/tests/libmemcached-1.0/pool.cc b/tests/libmemcached-1.0/pool.cc
index 577c0e94..174e197f 100644
--- a/tests/libmemcached-1.0/pool.cc
+++ b/tests/libmemcached-1.0/pool.cc
@@ -252,10 +252,12 @@ static __attribute__((noreturn)) void* connection_release(void *arg)
pthread_exit(arg);
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunreachable-code"
test_return_t connection_pool3_test(memcached_st *memc)
{
#ifdef __APPLE__
- return TEST_SKIPPED;
+ SKIP_IF(__APPLE__);
#endif
memcached_pool_st* pool= memcached_pool_create(memc, 1, 1);
@@ -321,6 +323,7 @@ test_return_t connection_pool3_test(memcached_st *memc)
return TEST_SUCCESS;
}
+#pragma GCC diagnostic pop
static memcached_st * create_single_instance_memcached(const memcached_st *original_memc, const char *options)
{
diff --git a/tests/libmemcached-1.0/sasl.cc b/tests/libmemcached-1.0/sasl.cc
index 06f9e3db..f3b136f7 100644
--- a/tests/libmemcached-1.0/sasl.cc
+++ b/tests/libmemcached-1.0/sasl.cc
@@ -64,28 +64,21 @@ static test_return_t pre_sasl(memcached_st *)
*/
static test_return_t sasl_auth_test(memcached_st *memc)
{
-#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
- if (LIBMEMCACHED_WITH_SASL_SUPPORT)
- {
- test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
- test_compare(MEMCACHED_SUCCESS, memcached_delete(memc, "foo", 3, 0));
- test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
- test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
- test_compare(MEMCACHED_INVALID_ARGUMENTS, memcached_destroy_sasl_auth_data(NULL));
- memcached_quit(memc);
-
- test_compare(MEMCACHED_AUTH_FAILURE,
- memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
- test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
-
- memcached_quit(memc);
- return TEST_SUCCESS;
- }
-#else
- (void)memc;
-#endif
+ SKIP_IF(libmemcached_has_feature(LIBMEMCACHED_FEATURE_HAS_SASL));
+
+ test_compare(MEMCACHED_SUCCESS, memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
+ test_compare(MEMCACHED_SUCCESS, memcached_delete(memc, "foo", 3, 0));
+ test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
+ test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
+ test_compare(MEMCACHED_INVALID_ARGUMENTS, memcached_destroy_sasl_auth_data(NULL));
+ memcached_quit(memc);
- return TEST_SKIPPED;
+ test_compare(MEMCACHED_AUTH_FAILURE,
+ memcached_set(memc, "foo", 3, "bar", 3, (time_t)0, (uint32_t)0));
+ test_compare(MEMCACHED_SUCCESS, memcached_destroy_sasl_auth_data(memc));
+
+ memcached_quit(memc);
+ return TEST_SUCCESS;
}
diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h
index 6bed25a9..8cf84c6e 100644
--- a/tests/libmemcached_world.h
+++ b/tests/libmemcached_world.h
@@ -47,7 +47,7 @@ static void *world_create(libtest::server_startup_st& servers, test_return_t& er
if (servers.sasl())
{
- SKIP_UNLESS(libtest::has_libmemcached_sasl());
+ SKIP_UNLESS(libmemcached_has_feature(LIBMEMCACHED_FEATURE_HAS_SASL));
// Assume we are running under valgrind, and bail
if (getenv("TESTS_ENVIRONMENT"))
diff --git a/tests/memcp.cc b/tests/memcp.cc
index 4139437b..d49b1775 100644
--- a/tests/memcp.cc
+++ b/tests/memcp.cc
@@ -66,7 +66,7 @@ static test_return_t help_test(void *)
static test_return_t server_test(void *)
{
int fd;
- std::string tmp_file= create_tmpfile("memcp", fd);
+ std::string tmp_file= libtest::create_tmpfile("memcp", fd);
ASSERT_TRUE(tmp_file.c_str());
struct stat buf;
ASSERT_EQ(fstat(fd, &buf), 0);