Utility providing methods for negative testing of assertion macros.

Synopsis

Declared in <bsls_asserttest.h>

struct AssertTest;

Description

This utility struct provides a suite of methods designed for use in conjunction with preprocessor macros during the negative testing of defensive checks using the facilities provided by the bsls_assert component. Unlike usual BDE functionality methods in this struct provide wide contracts because they need to function without assertion failures during testing, under unforeseen circumstances.

Static Member Functions

Name

Description

catchProbe

Return whether a caught assertion failure matches the expected probe.

catchProbeRaw

Return whether a caught assertion matches a raw failure probe.

failTestDriver [noreturn]

Throw or abort in response to an assertion violation.

failTestDriverByReview

Throw or abort in response to a review violation.

isValidAssertBuild

Return whether specString is a valid assertion build‐type specifier.

isValidExpected

Return whether specChar is a valid expected‐result specifier.

isValidExpectedLevel

Return whether specChar is a valid expected assertion level.

tryProbe

Return whether a pass‐probe specification is valid.

tryProbeRaw

Return whether a raw pass‐probe specification is valid.

Created with MrDocs