mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Change bassert to always call assert
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#error "PlatformConfig.h must come first!"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// This file defines miscellaneous macros for debugging, assertions, etc.
|
||||
|
||||
#if BEAST_FORCE_DEBUG
|
||||
@@ -109,6 +111,7 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
|
||||
*/
|
||||
#define BDBG(dbgtext) { beast::String tempDbgBuf; tempDbgBuf << dbgtext; beast::Logger::outputDebugString (tempDbgBuf); }
|
||||
|
||||
#if 0
|
||||
/** This will always cause an assertion failure.
|
||||
It is only compiled in a debug build, (unless BEAST_LOG_ASSERTIONS is enabled for your build).
|
||||
@see bassert
|
||||
@@ -122,6 +125,11 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
|
||||
@see bassertfalse
|
||||
*/
|
||||
#define bassert(expression) { if (! (expression)) beast_reportFatalError(#expression,__FILE__,__LINE__); }
|
||||
#else
|
||||
|
||||
#define bassertfalse assert(false)
|
||||
#define bassert(expression) assert(expression)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
}
|
||||
*lhs++ = UInt (part);
|
||||
}
|
||||
bassert (carry == 0) // overflow
|
||||
bassert (carry == 0); // overflow
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// For Journal and Debug
|
||||
#include "../../modules/beast_core/beast_core.h"
|
||||
|
||||
#include "impl/Assert.cpp"
|
||||
#include "impl/Debug.cpp"
|
||||
#include "impl/Journal.cpp"
|
||||
#include "impl/LeakChecked.cpp"
|
||||
|
||||
37
beast/utility/impl/Assert.cpp
Normal file
37
beast/utility/impl/Assert.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
namespace beast {
|
||||
|
||||
class BassertUnitTests : public UnitTest
|
||||
{
|
||||
public:
|
||||
void runTest ()
|
||||
{
|
||||
beginTestCase ("bassert");
|
||||
bassert (false);
|
||||
}
|
||||
|
||||
BassertUnitTests () : UnitTest ("bassert", "beast", runManual) { }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
static BassertUnitTests bassertUnitTests;
|
||||
}
|
||||
Reference in New Issue
Block a user