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

Return whether a caught assertion failure matches the expected probe&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
bool
catchProbe(
    char expectedResult,
    bool checkLevel,
    char expectedLevel,
    xref:BloombergLP/bsls/AssertTestException.adoc[AssertTestException] const& caughtException,
    char const* testDriverFileName);
----

== Description

Return `true` if the specified `expectedResult` is `F` (for Fail), the specified `checkLevel` flag is `false` or the `expectedLevel` is as wide or wider than the actual assertion failure level, the specified `caughtException` contains valid fields, and the specified `testDriverFileName` is either null or refers to the same (valid) component name as the filename in `caughtException`&semi; otherwise, return `false`&period; If `expectedResult`, `testDriverFileName`, or any field of `caughtException` is invalid (i&period;e&period;, an invalid filename, null or empty expression text, or a non&hyphen;positive line number), this function reports the invalid value(s) to `stdout` before returning `false`&period; If `testDriverFileName` is not null, but does not reflect the same component name as the otherwise valid filename in `caughtException`, this function prints a message delineating the mismatching deduced component names to `stdout` before returning `false`&period;

== Return Value

`true` if the failure probe matches, else `false`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *expectedResult*
| expected outcome (`P` for pass, `F` for fail)
| *checkLevel*
| whether to compare assertion levels
| *expectedLevel*
| expected assertion level (`S`, `A`, `O`, or `I`)
| *caughtException*
| exception thrown by the assertion handler
| *testDriverFileName*
| test&hyphen;driver file, or null to skip origination
|===


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