[#BloombergLP-bsls-FuzzTestPreconditionTracker]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::FuzzTestPreconditionTracker
:relfileprefix: ../../
:mrdocs:

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

== Synopsis

Declared in `&lt;bsls&lowbar;fuzztest&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct FuzzTestPreconditionTracker;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/handleAssertViolation.adoc[`handleAssertViolation`] 
| 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&colon;&colon;getOriginalAssertionHandler` otherwise&period;
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/handleException.adoc[`handleException`] 
| Invoke the assertion&sol;review handler returned by `FuzzTestHandlerGuard&colon;&colon;getOriginalAssertionHandler` or `FuzzTestHandlerGuard&colon;&colon;getOriginalReviewHandler` if the assertion&sol;review violation wrapped by the specified `exception` was encountered in a component different from one supplied to `initStaticState`, and do nothing otherwise&period;
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/handlePreconditionsBegin.adoc[`handlePreconditionsBegin`] 
| Increment the assertion&sol;review block depth level counter&period;
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/handlePreconditionsEnd.adoc[`handlePreconditionsEnd`] 
| Decrement the assertion&sol;review block depth level counter and record that the first precondition block has ended if the depth level changed to 0&period; The behavior is undefined unless the depth level is positive&period;
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/handleReviewViolation.adoc[`handleReviewViolation`] 
| 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&colon;&colon;getOriginalAssertionHandler` otherwise&period;
| xref:BloombergLP/bsls/FuzzTestPreconditionTracker/initStaticState.adoc[`initStaticState`] 
| Store the specified `fileName` from the caller that invokes the top&hyphen;level function under test (via `BSLS&lowbar;FUZZTEST&lowbar;EVALUATE(X)`), and set the state to reflect that any precondition begin macro encountered will be the first&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
