BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsls::FuzzTestPreconditionTracker Struct Reference

#include <bsls_fuzztest.h>

Detailed Description

This utility class is used by the preprocessor macros to appropriately handle precondition violations that occur in different levels and components.

See bsls_fuzztest

Static Public Member Functions

static void handleAssertViolation (const AssertViolation &violation)
 
static void handleException (const FuzzTestPreconditionException &exception)
 
static void handlePreconditionsBegin ()
 
static void handlePreconditionsEnd ()
 
static void handleReviewViolation (const ReviewViolation &violation)
 
static void initStaticState (const char *fileName)
 

Member Function Documentation

◆ handleAssertViolation()

static void bsls::FuzzTestPreconditionTracker::handleAssertViolation ( const AssertViolation violation)
static

Throw a FuzzTestPreconditionException constructed from the specified violation if the assertion violation occurred after the first invocation of handlePreconditionsBegin but before the first invocation of handlePreconditionsEnd, and invoke the assertion handler returned by FuzzTestHandlerGuard::getOriginalAssertionHandler otherwise.

◆ handleException()

static void bsls::FuzzTestPreconditionTracker::handleException ( const FuzzTestPreconditionException exception)
static

Invoke the assertion/review handler returned by FuzzTestHandlerGuard::getOriginalAssertionHandler or FuzzTestHandlerGuard::getOriginalReviewHandler if the assertion/review violation wrapped by the specified exception was encountered in a component different from one supplied to initStaticState, and do nothing otherwise.

◆ handlePreconditionsBegin()

static void bsls::FuzzTestPreconditionTracker::handlePreconditionsBegin ( )
static

Increment the assertion/review block depth level counter.

◆ handlePreconditionsEnd()

static void bsls::FuzzTestPreconditionTracker::handlePreconditionsEnd ( )
static

Decrement the assertion/review block depth level counter and record that the first precondition block has ended if the depth level changed to 0.

Precondition
The behavior is undefined unless the depth level is positive.

◆ handleReviewViolation()

static void bsls::FuzzTestPreconditionTracker::handleReviewViolation ( const ReviewViolation violation)
static

Throw a FuzzTestPreconditionException constructed from the specified violation if the review violation occurred after the first invocation of handlePreconditionsBegin but before the first invocation of handlePreconditionsEnd, and invoke the assertion handler (not review handler) returned by FuzzTestHandlerGuard::getOriginalAssertionHandler otherwise.

◆ initStaticState()

static void bsls::FuzzTestPreconditionTracker::initStaticState ( const char *  fileName)
static

Store the specified fileName from the caller that invokes the top-level function under test (via BSLS_FUZZTEST_EVALUATE(X)), and set the state to reflect that any precondition begin macro encountered will be the first.


The documentation for this struct was generated from the following file: