UTPP
Loading...
Searching...
No Matches
UnitTest::TimeConstraint Class Reference

Defines maximum run time of a test. More...

#include <utpp.h>

Public Member Functions

template<typename R, typename P>
 TimeConstraint (std::chrono::duration< R, P > t, const char *file, int line)
 
 ~TimeConstraint ()
 

Detailed Description

Defines maximum run time of a test.

Constructor & Destructor Documentation

◆ TimeConstraint()

template<typename R, typename P>
UnitTest::TimeConstraint::TimeConstraint ( std::chrono::duration< R, P > t,
const char * file,
int line )

Initializes a TimeConstraint object.

Parameters
tmaxMaximum allowed duration
fileFilename associated with this constraint
lineLine number associated with this constraint

The object contains a timer that is started now. It also keeps track of the filename and line number where it has been created.

◆ ~TimeConstraint()

UnitTest::TimeConstraint::~TimeConstraint ( )
inline

If the timer is greater than allowed value it records a time constraint failure for the current test.


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