Definition in file massert.h.
Go to the source code of this file.
Defines | |
#define | ASSERT_EXIT_MECHANISM ::abort(); |
ASSERT_EXIT_MECHANISM tells how an ASSERT or ABORT should terminate execution. Two available options are abort and segfault. | |
#define | ABORT(x) |
Terminates execution, printing error message y to stdout, stderr, and Log::err(). | |
#define | ASSERT(x) |
Tests property x and terminates execution if it is false. | |
#define | ASSERTMSG(x, y) |
Tests property x and terminates execution with message y if it is false. |
#define ABORT | ( | x | ) |
Value:
{ \ printf(OUTPUT_FORMAT("Abort",x));\ fprintf(stderr, OUTPUT_FORMAT("Abort",x));\ ASSERT_EXIT_MECHANISM \ }
y
to stdout, stderr, and Log::err().
Uses ASSERT_EXIT_MECHANISM to exit.
x | message to be printed. |
Definition at line 120 of file massert.h.
Referenced by mace::_SerializeSet< mace::MaceKey >::add(), mace::_SerializeList< uint64_t >::add(), Log::binaryLog(), mace::_SerializeMap< std::string, Data >::clear(), mace::_SerializeSet< mace::MaceKey >::clear(), mace::AddressCacheEntry::deserialize(), VMRSSLimit::expire(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::get(), mace::map< std::string, std::string >::get(), Util::getAddr(), mace::_SerializeMap< std::string, Data >::getIterator(), mace::_SerializeSet< mace::MaceKey >::getIterator(), mace::_SerializeArray< uint64_t >::getIterator(), mace::_SerializeMap< std::string, Data >::insertKey(), Log::log(), mace::operator+(), mace::MaceKeyDiff::operator+(), mace::MaceKeyDiff::operator-(), mace::operator-(), SysUtil::select(), mace::AddressCacheEntry::serialize(), SockUtil::setNonblock(), mace::_SerializeMap< std::string, Data >::size(), mace::_SerializeSet< mace::MaceKey >::size(), and mace::_SerializeList< uint64_t >::size().
#define ASSERT | ( | x | ) |
Value:
{ \ if(x) {}\ else {\ printf(OUTPUT_FORMAT("Assert Failed", x));\ fprintf(stderr, OUTPUT_FORMAT("Assert Failed", x));\ ASSERT_EXIT_MECHANISM \ }\ }
x
and terminates execution if it is false.
Prints error message to stdout, stderr, and Log::err(). Uses ASSERT_EXIT_MECHANISM to exit.
x | property to be tested. |
Definition at line 129 of file massert.h.
Referenced by mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::add(), mace::LRUCache< uint, std::string >::add(), mace::LRUCache< uint, std::string >::clearDirty(), mace::Stopwatch::confirm(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::deserialize(), mace::sparse_array< T, size >::deserialize(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::get(), mace::hash_map< uint32_t, Log::MaceTraceStream *, mace::SoftState >::get(), mace::LRUCache< uint, std::string >::get(), BufferedBlockManager::getBlock(), mace::LRUCache< uint, std::string >::getDirty(), Util::getHostname(), mace::LRUCache< uint, std::string >::getLastDirtyKey(), SockUtil::getSockAddr(), StrUtilNamespace::getTypeFromTemplate(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::greatestScore(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::leastScore(), ScopedLock::lock(), mace::hash_map< uint32_t, Log::MaceTraceStream *, mace::SoftState >::lower_bound(), mace::LRUCache< uint, std::string >::LRUCache(), mace::Stopwatch::mark(), mace::ConstMapIterator< M >::next(), mace::MapIterator< M >::next(), mace::operator+(), RandomUtil::random(), mace::NodeCollection< mace::AddressCacheEntry, MAX_CACHE_SIZE >::random(), mace::LRUCache< uint, std::string >::remove(), mace::MapIterator< M >::remove(), mace::Stopwatch::start(), mace::Stopwatch::stop(), ScopedLock::unlock(), StatisticalFilter::valueToPercentile(), Log::writeBinaryLog(), and Log::writeTextLog().
#define ASSERTMSG | ( | x, | |||
y | ) |
Value:
{ \ if(x) {}\ else {\ printf(OUTPUT_FORMAT("Assert Failed", #y ": " #x));\ fprintf(stderr, OUTPUT_FORMAT("Assert Failed", #y ": " #x));\ ASSERT_EXIT_MECHANISM \ }\ }
x
and terminates execution with message y
if it is false.
Prints error message y
to stdout, stderr, and Log::err(). Uses ASSERT_EXIT_MECHANISM to exit.
x | property to be tested. | |
y | message to be printed. |
Definition at line 141 of file massert.h.
Referenced by SockUtil::init().