Merge with build trunk
authorBrian Aker <brian@tangent.org>
Sun, 8 Jan 2012 06:55:16 +0000 (22:55 -0800)
committerBrian Aker <brian@tangent.org>
Sun, 8 Jan 2012 06:55:16 +0000 (22:55 -0800)
27 files changed:
libmemcached-1.0/defaults.h
libmemcached-1.0/struct/memcached.h
libmemcached-1.0/struct/server.h
libmemcached-1.0/types/behavior.h
libmemcached/behavior.cc
libmemcached/connect.cc
libmemcached/hosts.cc
libmemcached/memcached.cc
m4/pandora_canonical.m4
m4/pandora_cxx_demangle.m4 [deleted file]
m4/pandora_have_libdl.m4 [deleted file]
m4/pandora_run_cpplint.m4 [deleted file]
tests/cli.am [new file with mode: 0644]
tests/include.am
tests/libmemcached-1.0/mem_functions.cc
tests/libmemcached_world.h
tests/mem_udp.cc
tests/memcapable.cc
tests/memcat.cc
tests/memcp.cc
tests/memdump.cc
tests/memexist.cc
tests/memflush.cc
tests/memrm.cc
tests/memslap.cc
tests/memstat.cc
tests/memtouch.cc

index 355e63aac3a3e6f832ab699330be0c4df4e64d36..38c29ba38112a47aab62714e1271b0395e948825 100644 (file)
@@ -50,5 +50,6 @@
 #define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU
 #define MEMCACHED_SERVER_FAILURE_LIMIT 5
 #define MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT 2
+#define MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT 0
 
 
index 564eb74e55b9c825252a2cf16dd6eed16c5db8cb..a3f9d279306d9e8a705f9163f2de611a5e6d3bff 100644 (file)
@@ -82,6 +82,7 @@ struct memcached_st {
   int32_t poll_timeout;
   int32_t connect_timeout; // How long we will wait on connect() before we will timeout
   int32_t retry_timeout;
+  int32_t dead_timeout;
   int send_size;
   int recv_size;
   void *user_data;
index 183b37393226afb9629eea876a68d08782a4b577..245b4b9bbf6964703a24c055f6d948834d02d2ab 100644 (file)
 #define MEMCACHED_NI_MAXHOST 1025
 #endif
 
+#ifdef NI_MAXSERV
+#define MEMCACHED_NI_MAXSERV NI_MAXSERV
+#else
+#define MEMCACHED_NI_MAXSERV 32
+#endif
+
 enum memcached_server_state_t {
   MEMCACHED_SERVER_STATE_NEW, // fd == -1, no address lookup has been done
   MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathered
index 192b89e490bc5c79d78de971c50e831a236d7d80..d0af189ada06817b9fb8a6e9d880286ee2211adb 100644 (file)
@@ -75,6 +75,7 @@ enum memcached_behavior_t {
   MEMCACHED_BEHAVIOR_TCP_KEEPIDLE,
   MEMCACHED_BEHAVIOR_LOAD_FROM_FILE,
   MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS,
+  MEMCACHED_BEHAVIOR_DEAD_TIMEOUT,
   MEMCACHED_BEHAVIOR_MAX
 };
 
index 9769759ba884a58b8cb37067893cd50d0aaf9819..8ffbd665ec570ae29d76fddc7571d9804d6849fe 100644 (file)
@@ -52,7 +52,7 @@ memcached_return_t memcached_behavior_set(memcached_st *ptr,
                                           const memcached_behavior_t flag,
                                           uint64_t data)
 {
-  if (not ptr)
+  if (ptr == NULL)
   {
     return MEMCACHED_INVALID_ARGUMENTS;
   }
@@ -153,7 +153,9 @@ memcached_return_t memcached_behavior_set(memcached_st *ptr,
   case MEMCACHED_BEHAVIOR_KETAMA:
     {
       if (data) // Turn on
+      {
         return memcached_behavior_set_distribution(ptr, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA);
+      }
 
       return memcached_behavior_set_distribution(ptr, MEMCACHED_DISTRIBUTION_MODULA);
     }
@@ -181,17 +183,17 @@ memcached_return_t memcached_behavior_set(memcached_st *ptr,
 
   case MEMCACHED_BEHAVIOR_VERIFY_KEY:
     if (ptr->flags.binary_protocol)
+    {
       return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
                                         memcached_literal_param("MEMCACHED_BEHAVIOR_VERIFY_KEY if the binary protocol has been enabled."));
+    }
     ptr->flags.verify_key= bool(data);
     break;
 
   case MEMCACHED_BEHAVIOR_SORT_HOSTS:
     {
       ptr->flags.use_sort_hosts= bool(data);
-      run_distribution(ptr);
-
-      break;
+      return run_distribution(ptr);
     }
 
   case MEMCACHED_BEHAVIOR_POLL_TIMEOUT:
@@ -211,6 +213,10 @@ memcached_return_t memcached_behavior_set(memcached_st *ptr,
     ptr->retry_timeout= int32_t(data);
     break;
 
+  case MEMCACHED_BEHAVIOR_DEAD_TIMEOUT:
+    ptr->dead_timeout= int32_t(data);
+    break;
+
   case MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE:
     ptr->send_size= (int32_t)data;
     send_quit(ptr);
@@ -355,6 +361,9 @@ uint64_t memcached_behavior_get(memcached_st *ptr,
   case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT:
     return (uint64_t)ptr->retry_timeout;
 
+  case MEMCACHED_BEHAVIOR_DEAD_TIMEOUT:
+    return uint64_t(ptr->dead_timeout);
+
   case MEMCACHED_BEHAVIOR_SND_TIMEOUT:
     return (uint64_t)ptr->snd_timeout;
 
@@ -490,9 +499,7 @@ memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, memcac
     }
 
     ptr->distribution= type;
-    run_distribution(ptr);
-
-    return MEMCACHED_SUCCESS;
+    return run_distribution(ptr);
   }
 
   return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
@@ -555,6 +562,7 @@ const char *libmemcached_string_behavior(const memcached_behavior_t flag)
   case MEMCACHED_BEHAVIOR_VERIFY_KEY: return "MEMCACHED_BEHAVIOR_VERIFY_KEY";
   case MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT: return "MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT";
   case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT: return "MEMCACHED_BEHAVIOR_RETRY_TIMEOUT";
+  case MEMCACHED_BEHAVIOR_DEAD_TIMEOUT: return "MEMCACHED_BEHAVIOR_DEAD_TIMEOUT";
   case MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED: return "MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED";
   case MEMCACHED_BEHAVIOR_KETAMA_HASH: return "MEMCACHED_BEHAVIOR_KETAMA_HASH";
   case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL: return "MEMCACHED_BEHAVIOR_BINARY_PROTOCOL";
@@ -604,11 +612,15 @@ memcached_return_t memcached_bucket_set(memcached_st *self,
 {
   memcached_return_t rc;
 
-  if (not self)
+  if (self == NULL)
+  {
     return MEMCACHED_INVALID_ARGUMENTS;
+  }
 
-  if (not host_map)
+  if (host_map == NULL)
+  {
     return MEMCACHED_INVALID_ARGUMENTS;
+  }
 
   memcached_server_distribution_t old= memcached_behavior_get_distribution(self);
 
index b81b25b992bf8fc57d5f7929cba9e2a4ff71b3cb..42cbe9bc9f502f224237ca3da09d9b336b96bafa 100644 (file)
@@ -554,6 +554,9 @@ static memcached_return_t network_connect(memcached_server_st *server)
 */
 static memcached_return_t backoff_handling(memcached_server_write_instance_st server, bool& in_timeout)
 {
+  struct timeval curr_time;
+  bool _gettime_success= (gettimeofday(&curr_time, NULL) == 0);
+
   /* 
     If we hit server_failure_limit then something is completely wrong about the server.
 
@@ -568,7 +571,21 @@ static memcached_return_t backoff_handling(memcached_server_write_instance_st se
     if (_is_auto_eject_host(server->root))
     {
       set_last_disconnected_host(server);
-      run_distribution((memcached_st *)server->root);
+
+      // Retry dead servers if requested
+      if (_gettime_success and server->root->dead_timeout > 0)
+      {
+        server->next_retry= curr_time.tv_sec +server->root->dead_timeout;
+
+        // We only retry dead servers once before assuming failure again
+        server->server_failure_counter= server->root->server_failure_limit -1;
+      }
+
+      memcached_return_t rc;
+      if (memcached_failed(rc= run_distribution((memcached_st *)server->root)))
+      {
+        return memcached_set_error(*server, rc, MEMCACHED_AT, memcached_literal_param("Backoff handling failed during run_distribution"));
+      }
 
       return memcached_set_error(*server, MEMCACHED_SERVER_MARKED_DEAD, MEMCACHED_AT);
     }
@@ -584,9 +601,6 @@ static memcached_return_t backoff_handling(memcached_server_write_instance_st se
 
   if (server->state == MEMCACHED_SERVER_STATE_IN_TIMEOUT)
   {
-    struct timeval curr_time;
-    bool _gettime_success= (gettimeofday(&curr_time, NULL) == 0);
-
     /*
       If next_retry is less then our current time, then we reset and try everything again.
     */
index ac6b03ad0e810115d16e673f795805ec5cb7bb96..337a999aa91c2f397fac641c7a69eaf3fcd22db5 100644 (file)
@@ -217,7 +217,7 @@ static memcached_return_t update_continuum(memcached_st *ptr)
     if (is_ketama_weighted)
     {
         float pct= (float)list[host_index].weight / (float)total_weight;
-        pointer_per_server= (uint32_t) ((floor((float) (pct * MEMCACHED_POINTS_PER_SERVER_KETAMA / 4 * (float)live_servers + 0.0000000001))) * 4);
+        pointer_per_server= (uint32_t) ((::floor((float) (pct * MEMCACHED_POINTS_PER_SERVER_KETAMA / 4 * (float)live_servers + 0.0000000001))) * 4);
         pointer_per_hash= 4;
         if (DEBUG)
         {
@@ -236,21 +236,21 @@ static memcached_return_t update_continuum(memcached_st *ptr)
            pointer_index < pointer_per_server / pointer_per_hash;
            pointer_index++)
       {
-        char sort_host[MEMCACHED_MAX_HOST_SORT_LENGTH]= "";
+        char sort_host[1 +MEMCACHED_NI_MAXHOST +1 +MEMCACHED_NI_MAXSERV +1 + MEMCACHED_NI_MAXSERV ]= "";
         int sort_host_length;
 
         // Spymemcached ketema key format is: hostname/ip:port-index
         // If hostname is not available then: /ip:port-index
-        sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH,
+        sort_host_length= snprintf(sort_host, sizeof(sort_host),
                                    "/%s:%u-%u",
                                    list[host_index].hostname,
                                    (uint32_t)list[host_index].port,
                                    pointer_index);
 
-        if (sort_host_length >= MEMCACHED_MAX_HOST_SORT_LENGTH || sort_host_length < 0)
+        if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
         {
           return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
-                                     memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
+                                     memcached_literal_param("snprintf(sizeof(sort_host))"));
         }
 
         if (DEBUG)
@@ -281,29 +281,29 @@ static memcached_return_t update_continuum(memcached_st *ptr)
            pointer_index <= pointer_per_server / pointer_per_hash;
            pointer_index++)
       {
-        char sort_host[MEMCACHED_MAX_HOST_SORT_LENGTH]= "";
+        char sort_host[MEMCACHED_NI_MAXHOST +1 +MEMCACHED_NI_MAXSERV +1 +MEMCACHED_NI_MAXSERV]= "";
         int sort_host_length;
 
         if (list[host_index].port == MEMCACHED_DEFAULT_PORT)
         {
-          sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH,
+          sort_host_length= snprintf(sort_host, sizeof(sort_host),
                                      "%s-%u",
                                      list[host_index].hostname,
                                      pointer_index - 1);
         }
         else
         {
-          sort_host_length= snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH,
+          sort_host_length= snprintf(sort_host, sizeof(sort_host),
                                      "%s:%u-%u",
                                      list[host_index].hostname,
                                      (uint32_t)list[host_index].port,
                                      pointer_index - 1);
         }
 
-        if (sort_host_length >= MEMCACHED_MAX_HOST_SORT_LENGTH || sort_host_length < 0)
+        if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
         {
           return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, 
-                                     memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
+                                     memcached_literal_param("snprintf(sizeof(sort_host)))"));
         }
 
         if (is_ketama_weighted)
index 62052ada5ac25ec75bbd6759d6fb37567aa9cfab..1726b35fce634d7117bdd8244d6549200820fecb 100644 (file)
@@ -96,6 +96,7 @@ static inline bool _memcached_init(memcached_st *self)
   self->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT;
   self->connect_timeout= MEMCACHED_DEFAULT_CONNECT_TIMEOUT;
   self->retry_timeout= MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT;
+  self->dead_timeout= MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT;
 
   self->send_size= -1;
   self->recv_size= -1;
@@ -234,7 +235,7 @@ memcached_st *memcached(const char *string, size_t length)
 memcached_return_t memcached_reset(memcached_st *ptr)
 {
   WATCHPOINT_ASSERT(ptr);
-  if (not ptr)
+  if (ptr == NULL)
   {
     return MEMCACHED_INVALID_ARGUMENTS;
   }
@@ -314,6 +315,7 @@ memcached_st *memcached_clone(memcached_st *clone, const memcached_st *source)
   new_clone->poll_timeout= source->poll_timeout;
   new_clone->connect_timeout= source->connect_timeout;
   new_clone->retry_timeout= source->retry_timeout;
+  new_clone->dead_timeout= source->dead_timeout;
   new_clone->distribution= source->distribution;
 
   if (hashkit_clone(&new_clone->hashkit, &source->hashkit) == NULL)
index e876a8fa77bea1cdcf60a1147d3859597125f95c..b7da1ac38b8cf586378913fd25fff023f66d5882 100644 (file)
@@ -171,25 +171,6 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[
     AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
   ])
 
-  AC_CACHE_CHECK([if system defines RUSAGE_THREAD], [ac_cv_rusage_thread],[
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-      [[
-#include <sys/time.h>
-#include <sys/resource.h>
-      ]],[[
-      int x= RUSAGE_THREAD;
-      ]])
-    ],[
-      ac_cv_rusage_thread=yes
-    ],[
-      ac_cv_rusage_thread=no
-    ])
-  ])
-  AS_IF([test "$ac_cv_rusage_thread" = "no"],[
-    AC_DEFINE([RUSAGE_THREAD], [RUSAGE_SELF],
-      [Define if system doesn't define])
-  ])
-
   AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
   AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
diff --git a/m4/pandora_cxx_demangle.m4 b/m4/pandora_cxx_demangle.m4
deleted file mode 100644 (file)
index 5ae6687..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check for all of the headers and libs that Drizzle needs. We check all
-dnl of these for plugins too, to ensure that all of the appropriate defines
-dnl are set.
-
-AC_DEFUN([PANDORA_CXX_DEMANGLE],[
-  AC_LANG_PUSH([C++])
-  save_CXXFLAGS="${CXXFLAGS}"
-  CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
-  AC_CHECK_HEADERS(cxxabi.h)
-  AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
-    char *foo= 0; int bar= 0;
-    foo= abi::__cxa_demangle(foo, foo, 0, &bar);
-  ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
-  CXXFLAGS="${save_CXXFLAGS}"
-  AC_LANG_POP()
-
-  AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
-    AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
-              [Define to 1 if you have the `abi::__cxa_demangle' function.])
-  ])
-])
diff --git a/m4/pandora_have_libdl.m4 b/m4/pandora_have_libdl.m4
deleted file mode 100644 (file)
index dde7163..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-#--------------------------------------------------------------------
-# Check for libdl
-#--------------------------------------------------------------------
-
-
-AC_DEFUN([_PANDORA_SEARCH_LIBDL],[
-
-  save_LIBS="$LIBS"
-  LIBS=""
-  AC_CHECK_LIB(dl,dlopen)
-  AC_CHECK_FUNCS(dlopen)
-  LIBDL_LIBS="$LIBS"
-  LIBS="${save_LIBS}"
-  AC_SUBST(LIBDL_LIBS)
-
-  AM_CONDITIONAL(HAVE_LIBDL, [test "x${ac_cv_func_dlopen}" = "xyes"])
-])
-
-AC_DEFUN([_PANDORA_HAVE_LIBDL],[
-
-  AC_ARG_ENABLE([libdl],
-    [AS_HELP_STRING([--disable-libdl],
-      [Build with libdl support @<:@default=on@:>@])],
-    [ac_enable_libdl="$enableval"],
-    [ac_enable_libdl="yes"])
-
-  _PANDORA_SEARCH_LIBDL
-])
-
-
-AC_DEFUN([PANDORA_HAVE_LIBDL],[
-  AC_REQUIRE([_PANDORA_HAVE_LIBDL])
-])
-
-AC_DEFUN([_PANDORA_REQUIRE_LIBDL],[
-  ac_enable_libdl="yes"
-  _PANDORA_SEARCH_LIBDL
-
-  AS_IF([test "$ac_cv_func_dlopen" != "yes"],[
-    AC_MSG_ERROR([libdl/dlopen() is required for ${PACKAGE}. On Debian this can be found in libc6-dev. On RedHat this can be found in glibc-devel.])
-  ])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBDL],[
-  AC_REQUIRE([_PANDORA_REQUIRE_LIBDL])
-])
diff --git a/m4/pandora_run_cpplint.m4 b/m4/pandora_run_cpplint.m4
deleted file mode 100644 (file)
index 6d3e952..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([PANDORA_RUN_CPPLINT],[
-  m4_syscmd([python config/make-lint.py])
-])
diff --git a/tests/cli.am b/tests/cli.am
new file mode 100644 (file)
index 0000000..9e47fdd
--- /dev/null
@@ -0,0 +1,146 @@
+# vim:ft=automake
+# Copyright (C) 2012 Data Differential
+# All rights reserved.
+#
+# Use and distribution licensed under the BSD license.  See
+# the COPYING file in the parent directory for full text.
+#
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+tests_memcapable_SOURCES= tests/memcapable.cc
+tests_memcapable_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memcapable_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcapable
+tests_memcapable_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memcapable
+noinst_PROGRAMS+= tests/memcapable
+
+tests_memstat_SOURCES= tests/memstat.cc
+tests_memstat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memstat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memstat
+tests_memstat_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memstat
+noinst_PROGRAMS+= tests/memstat
+
+tests_memcp_SOURCES= tests/memcp.cc
+tests_memcp_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memcp_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcp
+tests_memcp_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memcp
+noinst_PROGRAMS+= tests/memcp
+
+tests_memflush_SOURCES= tests/memflush.cc
+tests_memflush_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memflush_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memflush
+tests_memflush_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memflush
+noinst_PROGRAMS+= tests/memflush
+
+tests_memrm_SOURCES= tests/memrm.cc
+tests_memrm_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memrm_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memrm
+tests_memrm_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memrm
+noinst_PROGRAMS+= tests/memrm
+
+tests_memexist_SOURCES= tests/memexist.cc
+tests_memexist_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memexist_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memexist
+tests_memexist_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memexist
+noinst_PROGRAMS+= tests/memexist
+
+tests_memtouch_SOURCES= tests/memtouch.cc
+tests_memtouch_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memtouch_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memtouch
+tests_memtouch_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memtouch
+noinst_PROGRAMS+= tests/memtouch
+
+tests_memcat_SOURCES= tests/memcat.cc
+tests_memcat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memcat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcat
+tests_memcat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memcat
+noinst_PROGRAMS+= tests/memcat
+
+tests_memerror_SOURCES= tests/memerror.cc
+tests_memerror_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memerror_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memerror
+tests_memerror_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memerror
+noinst_PROGRAMS+= tests/memerror
+
+tests_memslap_SOURCES= tests/memslap.cc
+tests_memslap_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memslap_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memslap
+tests_memslap_LDADD= libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memslap
+noinst_PROGRAMS+= tests/memslap
+
+tests_memdump_SOURCES= tests/memdump.cc
+tests_memdump_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
+tests_memdump_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memdump
+tests_memdump_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
+check_PROGRAMS+= tests/memdump
+noinst_PROGRAMS+= tests/memdump
+
+test-memcp: clients/memcp
+       @echo "Testing memcp"
+       @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+valgrind-memcp: clients/memcat clients/memcp
+       @echo "Testing memcp"
+       @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+test-memflush: clients/memflush
+       @echo "Testing memflush"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @clients/memflush --servers="localhost:12555"
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+valgrind-memflush: clients/memflush
+       @echo "Testing memflush"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+test-memdump: clients/memdump clients/memcp
+       @echo "Testing memdump"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @clients/memcp --servers="localhost:12555" clients/memcat
+       @clients/memdump --servers="localhost:12555" > /dev/null
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+valgrind-memdump: clients/memcat clients/memcp
+       @echo "Testing memdump"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @clients/memcp --servers="localhost:12555" clients/memcat
+       @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+test-memstat: clients/memstat
+       @echo "Testing memstat"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @clients/memstat --servers="localhost:12555" > /dev/null
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
+valgrind-memstat: clients/memstat
+       @echo "Testing memstat"
+       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
+       @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
+       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
+       @rm tests/Xumemc.pid
+
index 23f0f89916e18d8cbb88b4b64fb9fb7874a38d0e..bfdb36b882a94f7f47d39f309a6575547b18fa11 100644 (file)
@@ -59,82 +59,7 @@ tests_hash_plus_LDADD= $(tests_testhashkit_DEPENDENCIES)
 check_PROGRAMS+= tests/hash_plus
 noinst_PROGRAMS+= tests/hash_plus
 
-tests_memcapable_SOURCES= tests/memcapable.cc
-tests_memcapable_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memcapable_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcapable
-tests_memcapable_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memcapable
-noinst_PROGRAMS+= tests/memcapable
-
-tests_memstat_SOURCES= tests/memstat.cc
-tests_memstat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memstat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memstat
-tests_memstat_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memstat
-noinst_PROGRAMS+= tests/memstat
-
-tests_memcp_SOURCES= tests/memcp.cc
-tests_memcp_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memcp_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcp
-tests_memcp_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memcp
-noinst_PROGRAMS+= tests/memcp
-
-tests_memflush_SOURCES= tests/memflush.cc
-tests_memflush_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memflush_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memflush
-tests_memflush_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memflush
-noinst_PROGRAMS+= tests/memflush
-
-tests_memrm_SOURCES= tests/memrm.cc
-tests_memrm_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memrm_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memrm
-tests_memrm_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memrm
-noinst_PROGRAMS+= tests/memrm
-
-tests_memexist_SOURCES= tests/memexist.cc
-tests_memexist_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memexist_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memexist
-tests_memexist_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memexist
-noinst_PROGRAMS+= tests/memexist
-
-tests_memtouch_SOURCES= tests/memtouch.cc
-tests_memtouch_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memtouch_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memtouch
-tests_memtouch_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memtouch
-noinst_PROGRAMS+= tests/memtouch
-
-tests_memcat_SOURCES= tests/memcat.cc
-tests_memcat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memcat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcat
-tests_memcat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memcat
-noinst_PROGRAMS+= tests/memcat
-
-tests_memerror_SOURCES= tests/memerror.cc
-tests_memerror_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memerror_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memerror
-tests_memerror_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memerror
-noinst_PROGRAMS+= tests/memerror
-
-tests_memslap_SOURCES= tests/memslap.cc
-tests_memslap_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memslap_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memslap
-tests_memslap_LDADD= libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memslap
-noinst_PROGRAMS+= tests/memslap
-
-tests_memdump_SOURCES= tests/memdump.cc
-tests_memdump_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
-tests_memdump_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memdump
-tests_memdump_LDADD=  libtest/libtest.la $(TESTS_LDADDS)
-check_PROGRAMS+= tests/memdump
-noinst_PROGRAMS+= tests/memdump
+include tests/cli.am
 
 test: check
 
@@ -144,64 +69,6 @@ check-local: $(TEST_DOCS)
 test-x: test-plus test-memcp test-memdump test-memflush test-memstat
        @echo "Tests completed"
 
-test-memcp: clients/memcp
-       @echo "Testing memcp"
-       @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-valgrind-memcp: clients/memcat clients/memcp
-       @echo "Testing memcp"
-       @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-test-memflush: clients/memflush
-       @echo "Testing memflush"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @clients/memflush --servers="localhost:12555"
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-valgrind-memflush: clients/memflush
-       @echo "Testing memflush"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-test-memdump: clients/memdump clients/memcp
-       @echo "Testing memdump"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @clients/memcp --servers="localhost:12555" clients/memcat
-       @clients/memdump --servers="localhost:12555" > /dev/null
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-valgrind-memdump: clients/memcat clients/memcp
-       @echo "Testing memdump"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @clients/memcp --servers="localhost:12555" clients/memcat
-       @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-test-memstat: clients/memstat
-       @echo "Testing memstat"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @clients/memstat --servers="localhost:12555" > /dev/null
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
-valgrind-memstat: clients/memstat
-       @echo "Testing memstat"
-       @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
-       @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
-       @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
-       @rm tests/Xumemc.pid
-
 test-mem: tests/var tests/libmemcached-1.0/testapp
        @tests/libmemcached-1.0/testapp
 
index dd2abef27d18de63078e232672f244707fe826d4..62b32473c77cd5448373bcebda78150cfb4904ae 100644 (file)
@@ -465,7 +465,7 @@ static test_return_t libmemcached_string_behavior_test(memcached_st *)
   {
     test_true(libmemcached_string_behavior(memcached_behavior_t(x)));
   }
-  test_compare(36, int(MEMCACHED_BEHAVIOR_MAX));
+  test_compare(37, int(MEMCACHED_BEHAVIOR_MAX));
 
   return TEST_SUCCESS;
 }
index ad55d17c600ed89e04187f753fc760d05dc13fdf..824aabe751adfa503384f780d83233d404f81db1 100644 (file)
@@ -31,7 +31,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 1591bdcf1c23f9263e76177bcb4f4d45f9312868..1ef95becad18fca438ada9365fbdc764f59d3331 100644 (file)
@@ -434,7 +434,7 @@ static test_return_t udp_decr_test(memcached_st *memc)
                memcached_set(memc, 
                              test_literal_param(__func__),
                              test_literal_param("1"),
-                             (time_t)0, (uint32_t)0));
+                             time_t(0), uint32_t(0)));
 
   Expected expected_ids;
   get_udp_request_ids(memc, expected_ids);
index 60fd00ada4820c0d68080279439a30045cfa11c0..c8adad18153a5dabde1ea04a795ed0cec95f0b4e 100644 (file)
@@ -105,7 +105,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index e8ed3efcb59346a6cc7f23fefff25060db4cbaac..ea64352eea809672a5fa74a8fac73e6c160c4e86 100644 (file)
@@ -136,7 +136,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index c22c4db7db55f28505c834641420e0ae1a7a1095..a929b6db5a438aff9ee0aed323277eabffd1d811 100644 (file)
@@ -94,7 +94,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 6e5a2aed8173df1d18e8226e5b875fc9eaaec3aa..0aeb0a99b82a908243b36b4e47f6f3870c65cf50 100644 (file)
@@ -121,7 +121,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 00fc3abf0da64eb9b68942b0f5e7f6e54fb03789..9de01fa36ef657dc3a3b58c6ff90eca29a4a64f3 100644 (file)
@@ -136,7 +136,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 8f91356c2b4714320decdfea9296fc9478ec1e81..6cafcbbab31894f19438110df62cd7af2b9a1162 100644 (file)
@@ -94,7 +94,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index bf2dc86a9235ca0902d121dcf914fd3334294b08..f3a1f84bc3ed105cae57c2cfb667957ba94a4e24 100644 (file)
@@ -134,7 +134,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 229a920cd27ff7ba197e84a72330270f78ede60c..21d66c5937672d8421bb02ff9fd44b01b8e047c8 100644 (file)
@@ -160,7 +160,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 44bc77aaf3f67331e3e74f35fb94afc969cd0dc0..ec7dd4f88cd6d30de2d2040236367e7ab431a30b 100644 (file)
@@ -107,7 +107,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }
 
index 21378d73833b4261385bec626cb6552d72736941..2710cb6c19856707e58da1c3d083dd2353c2daf1 100644 (file)
@@ -130,7 +130,7 @@ static void *world_create(server_startup_st& servers, test_return_t& error)
 {
   if (HAVE_MEMCACHED_BINARY == 0)
   {
-    error= TEST_FATAL;
+    error= TEST_SKIPPED;
     return NULL;
   }