*/
#include <libmemcached/common.h>
+#include "libmemcached/assert.hpp"
#include <cmath>
#include <sys/time.h>
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))
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);
}
libmemcached_free(ptr, ptr->ketama.continuum);
+ ptr->ketama.continuum= NULL;
memcached_array_free(ptr->_namespace);
ptr->_namespace= NULL;
_skipped(0),
_failed(0),
_total(0),
- _formatter(_name)
+ _formatter(frame_arg->name(), _name)
{
fatal_assert(arg);
}
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()
class Formatter {
public:
- Formatter(const std::string& arg);
+ Formatter(const std::string& frame_name, const std::string& arg);
~Formatter();
[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])
[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])
# ? _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])
[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.])])
])
void parent(memcached_st* arg)
{
+ assert(_parent != arg);
reset();
_parent= arg;
}