} // namespace libtest
#define fatal_message(__mesg) libtest::fatal(LIBYATL_DEFAULT_PARAM, __mesg)
+#define fatal_assert(__assert) if((__assert)) {} else { libtest::fatal(LIBYATL_DEFAULT_PARAM, #__assert); }
using namespace libtest;
-#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
if (getenv("LIBMEMCACHED_SERVER_NUMBER"))
{
int set_count= atoi(getenv("LIBMEMCACHED_SERVER_NUMBER"));
- assert(set_count >= 0);
+ fatal_assert(set_count >= 0);
world->servers().set_count(set_count);
}
else
const char *key,
size_t key_length)
{
- assert(key);
- assert(key_length);
+ fatal_assert(key);
+ fatal_assert(key_length);
return MEMCACHED_SUCCESS;
}
#include <config.h>
#include <libtest/test.hpp>
-#include <cassert>
-
#include <libmemcached/memcached.h>
#include <tests/deprecated.h>
test_return_t regression_bug_728286(memcached_st *)
{
memcached_server_st *servers= memcached_servers_parse("1.2.3.4:99");
- assert(servers);
+ fatal_assert(servers);
memcached_server_free(servers);
return TEST_SUCCESS;
#include <libhashkit-1.0/hashkit.h>
-#include <cassert>
#include <cerrno>
#include <memory>
#include <pthread.h>
/* Do Nothing */
size_t bigger= *((size_t *)(context));
(void)ptr;
- assert(bigger <= memcached_server_port(server));
+ fatal_assert(bigger <= memcached_server_port(server));
*((size_t *)(context))= memcached_server_port(server);
return MEMCACHED_SUCCESS;
/* sighandler_t function that always asserts false */
static void fail(int)
{
- assert(0);
+ fatal_assert(0);
}
#include <vector>
#include <string>
#include <cerrno>
-#include <cassert>
#include <libmemcached/memcached.h>
#include <libmemcached/util.h>
{
if (strcmp(memcached_server_name(instance), "localhost"))
{
- assert(not memcached_server_name(instance));
+ fatal_assert(not memcached_server_name(instance));
return MEMCACHED_FAILURE;
}
if (memcached_server_port(instance) < 8888 or memcached_server_port(instance) > 8892)
{
- assert(not memcached_server_port(instance));
+ fatal_assert(not memcached_server_port(instance));
return MEMCACHED_FAILURE;
}
if (instance->weight > 5 or instance->weight < 2)
{
- assert(not instance->weight);
+ fatal_assert(not instance->weight);
return MEMCACHED_FAILURE;
}
static void* connection_release(void *arg)
{
test_pool_context_st *resource= static_cast<test_pool_context_st *>(arg);
- assert(resource);
if (resource == NULL)
{
- abort();
+ fatal_message("resource == NULL");
}
// Release all of the memc we are holding
#pragma once
-#include <cassert>
-
/* The structure we use for the test system */
struct libmemcached_test_container_st
{
#include <libmemcached/udp.hpp>
#include <libmemcachedutil-1.0/util.h>
-#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>