BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsls::ProtocolTest< BSLS_TESTIMP > Class Template Reference

#include <bsls_protocoltest.h>

Public Member Functions

 ProtocolTest (bool verbose=false)
 Construct a ProtocolTest object.
 
BSLS_TESTIMP method (const char *methodDesc="")
 
bool testAbstract ()
 
bool testNoDataMembers ()
 
bool testVirtualDestructor ()
 
int failures () const
 
bool lastStatus () const
 

Detailed Description

template<class BSLS_TESTIMP>
class bsls::ProtocolTest< BSLS_TESTIMP >

This mechanism class template provides the implementation of protocol testing concerns via test* methods (for non-method concerns), and via operator-> (for method concerns). The BSLS_TESTIMP template parameter is required to be a class derived from ProtocolTestImp that provides test implementations of all protocol methods.

See bsls_protocoltest

Constructor & Destructor Documentation

◆ ProtocolTest()

template<class BSLS_TESTIMP >
bsls::ProtocolTest< BSLS_TESTIMP >::ProtocolTest ( bool  verbose = false)
inlineexplicit

Member Function Documentation

◆ failures()

template<class BSLS_TESTIMP >
int bsls::ProtocolTest< BSLS_TESTIMP >::failures ( ) const
inline

Return the number of failures encountered during testing of a protocol class. The returned value is 0 if all tests succeeded, or no tests ran.

◆ lastStatus()

template<class BSLS_TESTIMP >
bool bsls::ProtocolTest< BSLS_TESTIMP >::lastStatus ( ) const
inline

Return true if the last test completed successfully (or no test has yes completed) and false otherwise.

◆ method()

template<class BSLS_TESTIMP >
BSLS_TESTIMP bsls::ProtocolTest< BSLS_TESTIMP >::method ( const char *  methodDesc = "")
inline

Return a BSLS_TESTIMP object to perform testing of a specific method which gets called via operator->(). Note that BSLS_TESTIMP is a proxy to the actual protocol class.

◆ testAbstract()

template<class BSLS_TESTIMP >
bool bsls::ProtocolTest< BSLS_TESTIMP >::testAbstract ( )
inline

Return true (i.e., the test passed) if the protocol class being tested is abstract and return false (i.e., the test failed) otherwise. Increase the count of failures and set lastStatus to false on failure.

◆ testNoDataMembers()

template<class BSLS_TESTIMP >
bool bsls::ProtocolTest< BSLS_TESTIMP >::testNoDataMembers ( )
inline

Return true (i.e., the test passed) if the protocol class being tested contains no data fields and return false (i.e., the test failed) otherwise. Increase the count of failures and set lastStatus to false on failure.

◆ testVirtualDestructor()

template<class BSLS_TESTIMP >
bool bsls::ProtocolTest< BSLS_TESTIMP >::testVirtualDestructor ( )

Return true (i.e., the test passed) if the protocol class being tested has a virtual destructor and return false (i.e., the test failed) otherwise. Increase the failures count and set lastStatus to false on failure.


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