Quick Links: |
#include <bsls_asserttestexception.h>
Public Member Functions | |
BSLS_KEYWORD_CONSTEXPR | AssertTestException (const char *expression, const char *filename, int lineNumber, const char *level="UNKNOWN") |
const char * | expression () const |
const char * | filename () const |
const char * | level () const |
int | lineNumber () const |
This class is an implementation detail of the bsls
testing framework and should not be used directly in user code. It implements an immutable mechanism to communicate information about the context of an assertion that fails to a test-case handler.
See Component bsls_asserttestexception
BSLS_KEYWORD_CONSTEXPR bsls::AssertTestException::AssertTestException | ( | const char * | expression, | |
const char * | filename, | |||
int | lineNumber, | |||
const char * | level = "UNKNOWN" | |||
) |
Create a AssertTestException
object with the specified expression
, filename
, lineNumber
, and level
. The behavior is undefined unless 0 < line
and all of expression
, filename
, and level
point to valid null-terminated character strings that will remain unmodified for the lifetime of this object (e.g., string literals).
const char* bsls::AssertTestException::expression | ( | ) | const |
Return a string containing the program source of the assertion that has failed.
const char* bsls::AssertTestException::filename | ( | ) | const |
Return a string containing the filename of the source file containing the assertion that has failed.
const char* bsls::AssertTestException::level | ( | ) | const |
Return a string containing a representation of the level of assertion or review macro that failed.
int bsls::AssertTestException::lineNumber | ( | ) | const |
Return the number of the line within the file filename
containing the assertion that failed.