BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsls::FuzzTestHandlerGuard Class Reference

#include <bsls_fuzztest.h>

Detailed Description

This class provides a guard that will install and uninstall four handlers, one for assertion failure, one for review failure, one for BSLS_PRECONDITIONS_BEGIN, and one for BSLS_PRECONDITIONS_END, within its protected scope.

See bsls_fuzztest

Public Member Functions

 FuzzTestHandlerGuard ()
 
 ~FuzzTestHandlerGuard ()
 
Assert::ViolationHandler getOriginalAssertionHandler ()
 
Review::ViolationHandler getOriginalReviewHandler ()
 

Static Public Member Functions

static FuzzTestHandlerGuardinstance ()
 

Constructor & Destructor Documentation

◆ FuzzTestHandlerGuard()

bsls::FuzzTestHandlerGuard::FuzzTestHandlerGuard ( )
inline

Create a guard object, installing FuzzTestPreconditionTracker::handleAssertViolation, FuzzTestPreconditionTracker::handleReviewViolation, and the BEGIN/END handler.

Precondition
The behavior is undefined if the current assertion handler is FuzzTestPreconditionTracker::handleAssertViolation or the current review handler is FuzzTestPreconditionTracker::handleAssertViolation.

◆ ~FuzzTestHandlerGuard()

bsls::FuzzTestHandlerGuard::~FuzzTestHandlerGuard ( )
inline

Restore the failure handler that was in place when this object was created, reset the precondition BEGIN/END handlers to no-op, and destroy this guard.

Precondition
The behavior is undefined unless the current assertion handler is FuzzTestPreconditionTracker::handleAssertViolation and the current review handler is FuzzTestPreconditionTracker::handleAssertViolation.

Member Function Documentation

◆ getOriginalAssertionHandler()

Assert::ViolationHandler bsls::FuzzTestHandlerGuard::getOriginalAssertionHandler ( )
inline

Return the original assertion handler.

◆ getOriginalReviewHandler()

Review::ViolationHandler bsls::FuzzTestHandlerGuard::getOriginalReviewHandler ( )
inline

Return the original review handler.

◆ instance()

FuzzTestHandlerGuard * bsls::FuzzTestHandlerGuard::instance ( )
inlinestatic

Return the current fuzz test handler guard.

Precondition
The behavior is undefined unless a fuzz test handler guard is currently in scope.

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