From: Brian Aker Date: Thu, 6 Dec 2012 22:13:03 +0000 (-0500) Subject: Update spec/m4/etc. X-Git-Tag: 1.0.15~9^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=16381b55407865d6d45e73518865e18bf72c3b13;p=m6w6%2Flibmemcached Update spec/m4/etc. --- diff --git a/libmemcached/hosts.cc b/libmemcached/hosts.cc index c189d07b..73fb66af 100644 --- a/libmemcached/hosts.cc +++ b/libmemcached/hosts.cc @@ -36,6 +36,7 @@ */ #include +#include "libmemcached/assert.hpp" #include #include @@ -194,6 +195,7 @@ static memcached_return_t update_continuum(memcached_st *ptr) ptr->ketama.continuum= new_ptr; ptr->ketama.continuum_count= live_servers + MEMCACHED_CONTINUUM_ADDITION; } + assert_msg(ptr->ketama.continuum, "Programmer Error, empty ketama continuum"); uint64_t total_weight= 0; if (memcached_is_weighted_ketama(ptr)) @@ -327,9 +329,9 @@ static memcached_return_t update_continuum(memcached_st *ptr) pointer_counter+= pointer_per_server; } - WATCHPOINT_ASSERT(ptr); - WATCHPOINT_ASSERT(ptr->ketama.continuum); - WATCHPOINT_ASSERT(memcached_server_count(ptr) * MEMCACHED_POINTS_PER_SERVER <= MEMCACHED_CONTINUUM_SIZE); + assert_msg(ptr, "Programmer Error, no valid ptr"); + assert_msg(ptr->ketama.continuum, "Programmer Error, empty ketama continuum"); + assert_msg(memcached_server_count(ptr) * MEMCACHED_POINTS_PER_SERVER <= MEMCACHED_CONTINUUM_SIZE, "invalid size information being given to qsort()"); ptr->ketama.continuum_points_counter= pointer_counter; qsort(ptr->ketama.continuum, ptr->ketama.continuum_points_counter, sizeof(memcached_continuum_item_st), continuum_item_cmp); diff --git a/libmemcached/memcached.cc b/libmemcached/memcached.cc index 82d99f09..d430d116 100644 --- a/libmemcached/memcached.cc +++ b/libmemcached/memcached.cc @@ -144,6 +144,7 @@ static void __memcached_free(memcached_st *ptr, bool release_st) } libmemcached_free(ptr, ptr->ketama.continuum); + ptr->ketama.continuum= NULL; memcached_array_free(ptr->_namespace); ptr->_namespace= NULL; diff --git a/libtest/collection.cc b/libtest/collection.cc index dda1341a..bfd1fac2 100644 --- a/libtest/collection.cc +++ b/libtest/collection.cc @@ -85,7 +85,7 @@ Collection::Collection(Framework* frame_arg, _skipped(0), _failed(0), _total(0), - _formatter(_name) + _formatter(frame_arg->name(), _name) { fatal_assert(arg); } diff --git a/libtest/formatter.cc b/libtest/formatter.cc index 8e6b3ffb..e0a347a0 100644 --- a/libtest/formatter.cc +++ b/libtest/formatter.cc @@ -88,9 +88,11 @@ private: libtest::Timer _timer; }; -Formatter::Formatter(const std::string& arg) : - _suite_name(arg) +Formatter::Formatter(const std::string& frame_name, const std::string& arg) { + _suite_name= frame_name; + _suite_name+= "."; + _suite_name+= arg; } Formatter::~Formatter() diff --git a/libtest/formatter.hpp b/libtest/formatter.hpp index be80d5a5..10818d40 100644 --- a/libtest/formatter.hpp +++ b/libtest/formatter.hpp @@ -48,7 +48,7 @@ typedef std::vector TestCases; class Formatter { public: - Formatter(const std::string& arg); + Formatter(const std::string& frame_name, const std::string& arg); ~Formatter(); diff --git a/m4/ax_assert.m4 b/m4/ax_assert.m4 index 2d88a018..8750674b 100644 --- a/m4/ax_assert.m4 +++ b/m4/ax_assert.m4 @@ -56,9 +56,9 @@ AC_DEFUN([AX_ASSERT], [ax_enable_assert=no]) AS_IF([ test "$ax_enable_assert" = "yes" -o "$ax_enable_debug" = "yes" -o "$ac_cv_vcs_checkout" = "yes" ], - [ax_enable_assert="yes" - AC_DEFINE(NDEBUG,[1],[Define to 1 to enable assert'ing code.]) - ]) + [ax_enable_assert="yes"], + [ax_enable_assert="no" + AC_DEFINE(NDEBUG,[1],[Define to 1 to disable assert'ing code.])]) AC_MSG_CHECKING([for assert]) AC_MSG_RESULT([$ax_enable_assert]) diff --git a/m4/ax_debug.m4 b/m4/ax_debug.m4 index d83a87e9..ba1a9615 100644 --- a/m4/ax_debug.m4 +++ b/m4/ax_debug.m4 @@ -49,13 +49,11 @@ AC_DEFUN([AX_DEBUG], [AC_PREREQ([2.63])dnl AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], - [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],[ - ax_enable_debug=yes - AC_DEFINE(DEBUG, [ 1 ], [Define to 1 to enable debugging code.]) - ],[ - ax_enable_debug=no - AC_DEFINE(DEBUG, [ 0 ], [Define to 1 to enable debugging code.]) - ]) + [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], + [ax_enable_debug=yes + AC_DEFINE(DEBUG,[1],[Define to 1 to enable debugging code.])], + [ax_enable_debug=no + AC_DEFINE(DEBUG, [ 0 ], [Define to 1 to enable debugging code.])]) AC_MSG_CHECKING([for debug]) AC_MSG_RESULT([$ax_enable_debug]) diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4 index 3d5eb2e3..754955e0 100644 --- a/m4/ax_harden_compiler_flags.m4 +++ b/m4/ax_harden_compiler_flags.m4 @@ -52,7 +52,7 @@ # ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for # compatibility issues memcached_stat_st -#serial 6 +#serial 7 AC_DEFUN([_APPEND_LINK_FLAGS_ERROR], [AC_REQUIRE([AX_APPEND_LINK_FLAGS]) diff --git a/m4/ax_vcs_checkout.m4 b/m4/ax_vcs_checkout.m4 index 4b094c56..8047b65e 100644 --- a/m4/ax_vcs_checkout.m4 +++ b/m4/ax_vcs_checkout.m4 @@ -68,7 +68,8 @@ AC_DEFUN([AX_VCS_CHECKOUT], [ac_cv_vcs_checkout=no]) ]) - AM_CONDITIONAL([IS_VCS_CHECKOUT], [test "x$ac_cv_vcs_checkout" = "xyes"]) - AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"],[AC_DEFINE([VCS_CHECKOUT],[1],[Define if the code was built from VCS.])], + AM_CONDITIONAL([IS_VCS_CHECKOUT],[test "x$ac_cv_vcs_checkout" = "xyes"]) + AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"], + [AC_DEFINE([VCS_CHECKOUT],[1],[Define if the code was built from VCS.])], [AC_DEFINE([VCS_CHECKOUT],[0],[Define if the code was built from VCS.])]) ]) diff --git a/tests/libmemcached_test_container.h b/tests/libmemcached_test_container.h index 19fbc272..dd645b91 100644 --- a/tests/libmemcached_test_container.h +++ b/tests/libmemcached_test_container.h @@ -59,6 +59,7 @@ public: void parent(memcached_st* arg) { + assert(_parent != arg); reset(); _parent= arg; }