Cleanup for OSX 9
authorBrian Aker <brian@tangent.org>
Mon, 4 Nov 2013 11:17:45 +0000 (20:17 +0900)
committerBrian Aker <brian@tangent.org>
Mon, 4 Nov 2013 11:17:45 +0000 (20:17 +0900)
clients/execute.cc
configure.ac
libmemcached-1.0/memcached.h
libmemcached/io.cc
libmemcached/storage.cc
libtest/cmdline.cc
m4/ax_pthread.m4
m4/have_cinttypes.m4
m4/have_cstdint.m4
tests/libmemcached-1.0/generate.cc
tests/libmemcached-1.0/mem_functions.cc

index 3e9e4802dfd0bf3a96d2a138384e65fceecf95db..47319778e868b7b51efff6b40dffd9acdae552fa 100644 (file)
 
 unsigned int execute_set(memcached_st *memc, pairs_st *pairs, unsigned int number_of)
 {
-  unsigned int x;
-  unsigned int pairs_sent;
-
-  for (x= 0, pairs_sent= 0; x < number_of; x++)
+  uint32_t count= 0;
+  for (; count < number_of; ++count)
   {
-    memcached_return_t rc= memcached_set(memc, pairs[x].key, pairs[x].key_length,
-                                         pairs[x].value, pairs[x].value_length,
+    memcached_return_t rc= memcached_set(memc, pairs[count].key, pairs[count].key_length,
+                                         pairs[count].value, pairs[count].value_length,
                                          0, 0);
     if (memcached_failed(rc))
     {
-      fprintf(stderr, "%s:%d Failure on insert (%s) of %.*s\n",
-              __FILE__, __LINE__,
+      fprintf(stderr, "%s:%d Failure on %u insert (%s) of %.*s\n",
+              __FILE__, __LINE__, count,
               memcached_last_error_message(memc),
-              (unsigned int)pairs[x].key_length, pairs[x].key);
+              (unsigned int)pairs[count].key_length, pairs[count].key);
       
       // We will try to reconnect and see if that fixes the issue
       memcached_quit(memc);
-    }
-    else
-    {
-      pairs_sent++;
+
+      return count;
     }
   }
 
-  return pairs_sent;
+  return count;
 }
 
 /*
index b0870bbfc490758e6dc20372a07d63550379b03b..54177ac4656dac2547fdf244d72c6e1dd34a739c 100644 (file)
@@ -54,6 +54,14 @@ LT_LIB_M
 AC_PROG_CC_C99
 AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
 
+AC_DEFUN([CHECK_CXX0X],[
+          AC_LANG_PUSH([C++])
+          AX_CHECK_COMPILE_FLAG([-std=c++0x],[
+                                 CXXFLAGS="$CXXFLAGS -std=c++0x"])
+          AC_LANG_POP([C++])
+          ])
+CHECK_CXX0X
+
 AX_ASSERT
 
 AX_PLATFORM
index 3c11f6193e2f10997aa1cc868f61e64952b2e12a..bc16e7370953e112f68e808d27b3e0b2c152dacb 100644 (file)
@@ -43,7 +43,7 @@
 #endif
 
 #ifdef __cplusplus
-#  include <tr1/cinttypes>
+#  include <cinttypes>
 #  include <cstddef>
 #  include <cstdlib>
 #else
index ba4b347494a6e5261cafb68f7d9825a3e5ec0343..8796d5034b8a2dd82927443662e32918579dab58 100644 (file)
@@ -177,7 +177,7 @@ static bool process_input_buffer(memcached_instance_st* instance)
 }
 
 static memcached_return_t io_wait(memcached_instance_st* instance,
-                                  const memc_read_or_write read_or_write)
+                                  const short events)
 {
   /*
    ** We are going to block on write, but at least on Solaris we might block
@@ -187,7 +187,7 @@ static memcached_return_t io_wait(memcached_instance_st* instance,
    ** The test is moved down in the purge function to avoid duplication of
    ** the test.
  */
-  if (read_or_write == MEM_WRITE)
+  if (events & POLLOUT)
   {
     if (memcached_purge(instance) == false)
     {
@@ -197,12 +197,11 @@ static memcached_return_t io_wait(memcached_instance_st* instance,
 
   struct pollfd fds;
   fds.fd= instance->fd;
-  fds.events= POLLIN;
+  fds.events= events;
   fds.revents= 0;
 
-  if (read_or_write == MEM_WRITE) /* write */
+  if (fds.events & POLLOUT) /* write */
   {
-    fds.events= POLLOUT;
     instance->io_wait_count.write++;
   }
   else
@@ -371,7 +370,7 @@ static bool io_flush(memcached_instance_st* instance,
             continue;
           }
 
-          memcached_return_t rc= io_wait(instance, MEM_WRITE);
+          memcached_return_t rc= io_wait(instance, POLLOUT);
           if (memcached_success(rc))
           {
             continue;
@@ -409,12 +408,12 @@ static bool io_flush(memcached_instance_st* instance,
 
 memcached_return_t memcached_io_wait_for_write(memcached_instance_st* instance)
 {
-  return io_wait(instance, MEM_WRITE);
+  return io_wait(instance, POLLOUT);
 }
 
 memcached_return_t memcached_io_wait_for_read(memcached_instance_st* instance)
 {
-  return io_wait(instance, MEM_READ);
+  return io_wait(instance, POLLIN);
 }
 
 static memcached_return_t _io_fill(memcached_instance_st* instance)
@@ -440,7 +439,7 @@ static memcached_return_t _io_fill(memcached_instance_st* instance)
 #endif
         {
           memcached_return_t io_wait_ret;
-          if (memcached_success(io_wait_ret= io_wait(instance, MEM_READ)))
+          if (memcached_success(io_wait_ret= io_wait(instance, POLLIN)))
           {
             continue;
           }
@@ -576,7 +575,7 @@ memcached_return_t memcached_io_slurp(memcached_instance_st* instance)
 #ifdef __linux
       case ERESTART:
 #endif
-        if (memcached_success(io_wait(instance, MEM_READ)))
+        if (memcached_success(io_wait(instance, POLLIN)))
         {
           continue;
         }
index 80b5a7f1129b24845bd9e81b487a71efad73cc23..46ae15a953042d71954f9fd423645e81a1b15922 100644 (file)
@@ -378,7 +378,6 @@ static inline memcached_return_t memcached_send(memcached_st *shell,
   WATCHPOINT_SET(instance->io_wait_count.read= 0);
   WATCHPOINT_SET(instance->io_wait_count.write= 0);
 
-
   bool flush= true;
   if (memcached_is_buffering(instance->root) and verb == SET_OP)
   {
index e813eb592c4da4730350ff103ff1994b6bb1f213..29a22de657df8f823b50bd7c60d2011c723e3b49 100644 (file)
@@ -79,7 +79,10 @@ namespace {
          iter != built_argv.end();
          ++iter)
     {
-      arg_buffer << *iter << " ";
+      if (*iter)
+      {
+        arg_buffer << *iter << " ";
+      }
     }
 
     return arg_buffer.str();
index 6d400ed4e8e29dfc7a650e2ca704a228d0dc61ba..ebea7fb511c1e2c41f28bc1735d1cfa314af21c0 100644 (file)
@@ -82,7 +82,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 20
+#serial 22
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [
@@ -103,8 +103,8 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
-        AC_MSG_RESULT($ax_pthread_ok)
+        AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
+        AC_MSG_RESULT([$ax_pthread_ok])
         if test x"$ax_pthread_ok" = xno; then
                 PTHREAD_LIBS=""
                 PTHREAD_CFLAGS=""
@@ -160,10 +160,24 @@ case ${host_os} in
         ;;
 
         darwin*)
-        ax_pthread_flags="-pthread $ax_pthread_flags"
+        ax_pthread_flags="none -pthread $ax_pthread_flags"
         ;;
 esac
 
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+                  [AC_MSG_RESULT([yes])],
+                  [ax_pthread_extra_flags=
+                   AC_MSG_RESULT([no])])
+CFLAGS="$save_CFLAGS"
+
 if test x"$ax_pthread_ok" = xno; then
 for flag in $ax_pthread_flags; do
 
@@ -178,7 +192,7 @@ for flag in $ax_pthread_flags; do
                 ;;
 
                 pthread-config)
-                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
                 if test x"$ax_pthread_config" = xno; then continue; fi
                 PTHREAD_CFLAGS="`pthread-config --cflags`"
                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
@@ -193,7 +207,7 @@ for flag in $ax_pthread_flags; do
         save_LIBS="$LIBS"
         save_CFLAGS="$CFLAGS"
         LIBS="$PTHREAD_LIBS $LIBS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
 
         # Check for various functions.  We must include pthread.h,
         # since some functions may be macros.  (On the Sequent, we
@@ -219,7 +233,7 @@ for flag in $ax_pthread_flags; do
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        AC_MSG_RESULT($ax_pthread_ok)
+        AC_MSG_RESULT([$ax_pthread_ok])
         if test "x$ax_pthread_ok" = xyes; then
                 break;
         fi
@@ -245,9 +259,9 @@ if test "x$ax_pthread_ok" = xyes; then
                 [attr_name=$attr; break],
                 [])
         done
-        AC_MSG_RESULT($attr_name)
+        AC_MSG_RESULT([$attr_name])
         if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+            AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
                                [Define to necessary symbol if this constant
                                 uses a non-standard name on your system.])
         fi
@@ -261,24 +275,25 @@ if test "x$ax_pthread_ok" = xyes; then
             if test "$GCC" = "yes"; then
                 flag="-D_REENTRANT"
             else
+                # TODO: What about Clang on Solaris?
                 flag="-mt -D_REENTRANT"
             fi
             ;;
         esac
-        AC_MSG_RESULT(${flag})
+        AC_MSG_RESULT([$flag])
         if test "x$flag" != xno; then
             PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
         fi
 
         AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
-            ax_cv_PTHREAD_PRIO_INHERIT, [
-                AC_LINK_IFELSE([
-                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+            [ax_cv_PTHREAD_PRIO_INHERIT], [
+                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+                                                [[int i = PTHREAD_PRIO_INHERIT;]])],
                     [ax_cv_PTHREAD_PRIO_INHERIT=yes],
                     [ax_cv_PTHREAD_PRIO_INHERIT=no])
             ])
         AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
-            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+            [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
 
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
@@ -301,13 +316,13 @@ fi
 
 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
 
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
 
 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
 if test x"$ax_pthread_ok" = xyes; then
-        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
         :
 else
         ax_pthread_ok=no
index 3ba1316a4b6f3f264dba0c6bc7fa3626ddca7b43..fbd8c0d22b777f887a6595e0229c3c5abc2fa0cc 100644 (file)
@@ -40,7 +40,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 2
+#serial 3
 
 AC_DEFUN([AX_CXX_CINTTYPES], [
     AC_REQUIRE([AC_PROG_CXX])
@@ -59,18 +59,22 @@ AC_DEFUN([AX_CXX_CINTTYPES], [
         [ac_cxx_cinttypes_cinttypes="<cinttypes>"])
 
 # Look for tr1/cinttypes
-      AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([#include <tr1/cinttypes>], [
-          uint32_t foo= UINT32_C(1);
-          ])],
-        [ac_cxx_cinttypes_tr1_cinttypes="<tr1/cinttypes>"])
+      AS_IF([test -z "$ac_cxx_cinttypes_cinttypes"],[
+            AC_COMPILE_IFELSE([
+                              AC_LANG_PROGRAM([#include <tr1/cinttypes>], [
+                                              uint32_t foo= UINT32_C(1);
+                                              ])],
+                              [ac_cxx_cinttypes_tr1_cinttypes="<tr1/cinttypes>"])
 
 # Look for boost/cinttypes.hpp
-      AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([#include <boost/cinttypes.hpp>], [
-          uint32_t foo= UINT32_C(1); 
-          ])],
-        [ac_cxx_cinttypes_boost_cinttypes_hpp="<boost/cinttypes.hpp>"])
+            AS_IF([test -z "$ac_cxx_cinttypes_tr1_cinttypes"],[
+                  AC_COMPILE_IFELSE([
+                                    AC_LANG_PROGRAM([#include <boost/cinttypes.hpp>], [
+                                                    uint32_t foo= UINT32_C(1); 
+                                                    ])],
+                                    [ac_cxx_cinttypes_boost_cinttypes_hpp="<boost/cinttypes.hpp>"])
+                  ])
+            ])
 
       AC_LANG_POP
       AX_RESTORE_FLAGS
index 11d9616f2abdddd885e0df3e8a3a7e9355795648..cdd63c72a1596ac78c3d112da85fbd6b01463ded 100644 (file)
@@ -40,7 +40,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 2
+#serial 3
 
 
 AC_DEFUN([AX_CXX_CSTDINT], [
@@ -53,16 +53,22 @@ AC_DEFUN([AX_CXX_CSTDINT], [
       CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
 
       AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([#include <cstdint>], [ uint32_t t ])],
+        AC_LANG_PROGRAM([#include <cstdint>], [
+        uint32_t t 
+        ])],
         [ac_cxx_cstdint_cstdint="<cstdint>"])
 
-      AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([#include <tr1/cstdint>], [ uint32_t t ])],
-        [ac_cxx_cstdint_tr1_cstdint="<tr1/cstdint>"])
+      AS_IF([test -z "$ac_cxx_cstdint_cstdint"],[
+            AC_COMPILE_IFELSE([
+                              AC_LANG_PROGRAM([#include <tr1/cstdint>], [ uint32_t t ])],
+                              [ac_cxx_cstdint_tr1_cstdint="<tr1/cstdint>"])
 
-      AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([#include <boost/cstdint.hpp>], [ uint32_t t ])],
-        [ac_cxx_cstdint_boost_cstdint_hpp="<boost/cstdint.hpp>"])
+            AS_IF([test -z "$ac_cxx_cstdint_tr1_cstdint"],[
+                  AC_COMPILE_IFELSE([
+                                    AC_LANG_PROGRAM([#include <boost/cstdint.hpp>], [ uint32_t t ])],
+                                    [ac_cxx_cstdint_boost_cstdint_hpp="<boost/cstdint.hpp>"])
+                  ])
+            ])
 
       AC_LANG_POP
       AX_RESTORE_FLAGS
index ada9d2c2b25a79d5c3c2614c7c9a6cbf7d90e582..4ebaa98b2d723deceedce870017d394489a88c85 100644 (file)
 #include "clients/generator.h"
 #include "clients/execute.h"
 
-#define GLOBAL_COUNT 10000
+#include "tests/memc.hpp"
+
+#ifdef __APPLE__
+# define GLOBAL_COUNT 3000
+#else
+# define GLOBAL_COUNT 10000
+#endif
+
 #define GLOBAL2_COUNT 100
 
 using namespace libtest;
@@ -69,9 +76,8 @@ test_return_t cleanup_pairs(memcached_st*)
 static test_return_t generate_pairs(memcached_st *)
 {
   global_pairs= pairs_generate(GLOBAL_COUNT, 400);
-  global_count= GLOBAL_COUNT;
 
-  for (size_t x= 0; x < global_count; x++)
+  for (size_t x= 0; x < GLOBAL_COUNT; ++x)
   {
     global_keys[x]= global_pairs[x].key;
     global_keys_length[x]=  global_pairs[x].key_length;
@@ -83,18 +89,17 @@ static test_return_t generate_pairs(memcached_st *)
 test_return_t generate_large_pairs(memcached_st *memc)
 {
   global_pairs= pairs_generate(GLOBAL2_COUNT, MEMCACHED_MAX_BUFFER+10);
-  global_count= GLOBAL2_COUNT;
 
-  for (size_t x= 0; x < global_count; x++)
+  for (size_t x= 0; x < GLOBAL2_COUNT; x++)
   {
     global_keys[x]= global_pairs[x].key;
     global_keys_length[x]=  global_pairs[x].key_length;
   }
 
   memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, true);
-  unsigned int check_execute= execute_set(memc, global_pairs, (unsigned int)global_count);
+  global_count= execute_set(memc, global_pairs, (unsigned int)GLOBAL2_COUNT);
 
-  test_true(check_execute > (global_count / 2));
+  ASSERT_TRUE(global_count > (GLOBAL2_COUNT / 2));
 
   return TEST_SUCCESS;
 }
@@ -103,12 +108,12 @@ test_return_t generate_data(memcached_st *memc)
 {
   test_compare(TEST_SUCCESS, generate_pairs(memc));
 
-  unsigned int check_execute= execute_set(memc, global_pairs, (unsigned int)global_count);
+  global_count= execute_set(memc, global_pairs, (unsigned int)GLOBAL_COUNT);
 
   /* Possible false, positive, memcached may have ejected key/value based on
    * memory needs. */
 
-  test_true(check_execute > (global_count / 2));
+  ASSERT_TRUE(global_count > (GLOBAL2_COUNT / 2));
 
   return TEST_SUCCESS;
 }
@@ -117,9 +122,9 @@ test_return_t generate_data_with_stats(memcached_st *memc)
 {
   test_compare(TEST_SUCCESS, generate_pairs(memc));
 
-  unsigned int check_execute= execute_set(memc, global_pairs, (unsigned int)global_count);
+  global_count= execute_set(memc, global_pairs, (unsigned int)GLOBAL2_COUNT);
 
-  test_compare(check_execute, global_count);
+  ASSERT_EQ(global_count, GLOBAL2_COUNT);
 
   // @todo hosts used size stats
   memcached_return_t rc;
@@ -169,7 +174,7 @@ test_return_t get_read_count(memcached_st *memc)
     uint32_t flags;
     uint32_t count;
 
-    for (size_t x= count= 0; x < global_count; x++)
+    for (size_t x= count= 0; x < global_count; ++x)
     {
       memcached_return_t rc;
       return_value= memcached_get(memc_clone, global_keys[x], global_keys_length[x],
@@ -192,13 +197,14 @@ test_return_t get_read_count(memcached_st *memc)
 
 test_return_t get_read(memcached_st *memc)
 {
+  test::Memc clone(memc);
   size_t keys_returned= 0;
-  for (size_t x= 0; x < global_count; x++)
+  for (size_t x= 0; x < global_count; ++x)
   {
     size_t return_value_length;
     uint32_t flags;
     memcached_return_t rc;
-    char *return_value= memcached_get(memc, global_keys[x], global_keys_length[x],
+    char *return_value= memcached_get(&clone, global_keys[x], global_keys_length[x],
                                       &return_value_length, &flags, &rc);
     /*
       test_true(return_value);
@@ -338,10 +344,11 @@ test_return_t delete_generate(memcached_st *memc)
       total++;
     }
   }
+
   /*
     Possible false, positive, memcached may have ejected key/value based on memory needs.
   */
-  test_true(total > (global_count / 2));
+  ASSERT_TRUE(total);
 
   return TEST_SUCCESS;
 }
@@ -359,10 +366,7 @@ test_return_t delete_buffer_generate(memcached_st *memc)
     }
   }
 
-  /*
-     Possible false, positive, memcached may have ejected key/value based on memory needs.
-  */
-  test_true(total > (global_count / 2));
+  ASSERT_TRUE(total);
 
   return TEST_SUCCESS;
 }
index a6c38c5b1a8c6a5b6ff7b6cd740fddf3889046c6..e69e0e121396e132a179a0953f29d8a68a99aea2 100644 (file)
@@ -1766,7 +1766,7 @@ test_return_t mget_execute(memcached_st *original_memc)
                                          keys.key_at(x), keys.length_at(x),
                                          blob, sizeof(blob),
                                          0, 0);
-    test_true(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED);
+    ASSERT_TRUE_(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED, "Returned %s", memcached_strerror(NULL, rc));
     test_compare(query_id +1, memcached_query_id(memc));
   }
 
@@ -2497,14 +2497,15 @@ test_return_t user_supplied_bug10(memcached_st *memc)
 */
 test_return_t user_supplied_bug11(memcached_st *memc)
 {
-  memcached_st *mclone= memcached_clone(NULL, memc);
-
-  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, true);
-  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, true);
-  memcached_behavior_set(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, size_t(-1));
+  (void)memc;
+#ifndef __APPLE__
+  test::Memc mclone(memc);
 
-  test_compare(-1, int32_t(memcached_behavior_get(mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT)));
+  memcached_behavior_set(&mclone, MEMCACHED_BEHAVIOR_NO_BLOCK, true);
+  memcached_behavior_set(&mclone, MEMCACHED_BEHAVIOR_TCP_NODELAY, true);
+  memcached_behavior_set(&mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, size_t(-1));
 
+  test_compare(-1, int32_t(memcached_behavior_get(&mclone, MEMCACHED_BEHAVIOR_POLL_TIMEOUT)));
 
   libtest::vchar_t value;
   value.reserve(512);
@@ -2515,11 +2516,11 @@ test_return_t user_supplied_bug11(memcached_st *memc)
 
   for (unsigned int x= 1; x <= 100000; ++x)
   {
-    memcached_return_t rc= memcached_set(mclone, test_literal_param("foo"), &value[0], value.size(), 0, 0);
+    memcached_return_t rc= memcached_set(&mclone, test_literal_param("foo"), &value[0], value.size(), 0, 0);
     (void)rc;
   }
 
-  memcached_free(mclone);
+#endif
 
   return TEST_SUCCESS;
 }
@@ -2621,7 +2622,7 @@ test_return_t user_supplied_bug14(memcached_st *memc)
     memcached_return_t rc= memcached_set(memc, test_literal_param("foo"),
                                          &value[0], current_length,
                                          (time_t)0, (uint32_t)0);
-    test_true(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED);
+    ASSERT_TRUE_(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED, "Instead got %s", memcached_strerror(NULL, rc));
 
     size_t string_length;
     uint32_t flags;