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

This mechanism class template provides the implementation of protocol testing concerns via `test&ast;` methods (for non&hyphen;method concerns), and via `operator&hyphen;&gt;` (for method concerns)&period; The `BSLS&lowbar;TESTIMP` template parameter is required to be a class derived from `ProtocolTestImp` that provides test implementations of all protocol methods&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BSLS&lowbar;TESTIMP&gt;
class ProtocolTest;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/ProtocolTest/2constructor.adoc[`ProtocolTest`]         [.small]#[constructor]#
| Construct a `ProtocolTest` object&period;
| xref:BloombergLP/bsls/ProtocolTest/failures.adoc[`failures`] 
| Return the number of failures encountered during testing of a protocol class&period; The returned value is 0 if all tests succeeded, or no tests ran&period;
| xref:BloombergLP/bsls/ProtocolTest/lastStatus.adoc[`lastStatus`] 
| Return `true` if the last test completed successfully (or no test has yes completed) and `false` otherwise&period;
| xref:BloombergLP/bsls/ProtocolTest/method.adoc[`method`] 
| Return a `BSLS&lowbar;TESTIMP` object to perform testing of a specific method which gets called via `operator&hyphen;&gt;()`&period; Note that `BSLS&lowbar;TESTIMP` is a proxy to the actual protocol class&period;
| xref:BloombergLP/bsls/ProtocolTest/testAbstract.adoc[`testAbstract`] 
| Return `true` (i&period;e&period;, the test passed) if the protocol class being tested is abstract and return `false` (i&period;e&period;, the test failed) otherwise&period; Increase the count of `failures` and set `lastStatus` to `false` on failure&period;
| xref:BloombergLP/bsls/ProtocolTest/testNoDataMembers.adoc[`testNoDataMembers`] 
| Return `true` (i&period;e&period;, the test passed) if the protocol class being tested contains no data fields and return `false` (i&period;e&period;, the test failed) otherwise&period; Increase the count of `failures` and set `lastStatus` to `false` on failure&period;
| xref:BloombergLP/bsls/ProtocolTest/testVirtualDestructor.adoc[`testVirtualDestructor`] 
| Return `true` (i&period;e&period;, the test passed) if the protocol class being tested has a virtual destructor and return `false` (i&period;e&period;, the test failed) otherwise&period; Increase the `failures` count and set `lastStatus` to `false` on failure&period;
|===



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