YARP
Yet Another Robot Platform
yarp::robottestingframework::TestAsserter Class Reference

The yarp::robottestingframework::TestAsserter class is used to throw exception or to report messages/failures to a TestResult. More...

#include <yarp/robottestingframework/TestAsserter.h>

Classes

class  Private
 

Public Member Functions

 TestAsserter ()
 
virtual ~TestAsserter ()
 

Static Public Member Functions

static bool isApproxEqual (const double *left, const double *right, const double *l_thresholds, const double *h_thresholds, int length)
 Element-wise compare two vectors to determine if they are approximately equal, according to asymmetric thresholds that specify lower and upper bound. More...
 
static bool isApproxEqual (const double *left, const double *right, const double *thresholds, int length)
 Element-wise compare two vectors to determine if they are approximately equal, according to a threshold. More...
 
static bool isApproxEqual (const yarp::sig::Vector &left, const yarp::sig::Vector &right, const yarp::sig::Vector &thresholds)
 Element-wise compare two vectors to determine if they are approximately equal, according to a threshold. More...
 
static bool isApproxEqual (double left, double right, double l_th, double h_th)
 Compare two scalars to determine if they are approximately equal, according to asymmetric thresholds that specify upper and lower bound. More...
 

Detailed Description

The yarp::robottestingframework::TestAsserter class is used to throw exception or to report messages/failures to a TestResult.

Definition at line 22 of file TestAsserter.h.

Constructor & Destructor Documentation

◆ TestAsserter()

yarp::robottestingframework::TestAsserter::TestAsserter ( )
explicit

Definition at line 19 of file TestAsserter.cpp.

◆ ~TestAsserter()

yarp::robottestingframework::TestAsserter::~TestAsserter ( )
virtual

Definition at line 24 of file TestAsserter.cpp.

Member Function Documentation

◆ isApproxEqual() [1/4]

bool yarp::robottestingframework::TestAsserter::isApproxEqual ( const double *  left,
const double *  right,
const double *  l_thresholds,
const double *  h_thresholds,
int  length 
)
static

Element-wise compare two vectors to determine if they are approximately equal, according to asymmetric thresholds that specify lower and upper bound.

Both thresholds are assumed to be positive.

Parameters
leftleft operand
rightright operand
l_thresholdsa vector of thresholds whose elements are used when checking equality of corresponding elements of the left and right vectors. It specifies the low bound of the interval.
h_thresholdsa vector of thresholds whose elements are used when checking equality of corresponding elements of the left and right vectors. It specifies the upper bound of the interval.
lengthspecifies the lengths of all vectors
Returns
: the result of the comparison

Definition at line 37 of file TestAsserter.cpp.

◆ isApproxEqual() [2/4]

bool yarp::robottestingframework::TestAsserter::isApproxEqual ( const double *  left,
const double *  right,
const double *  thresholds,
int  length 
)
static

Element-wise compare two vectors to determine if they are approximately equal, according to a threshold.

The threshold is assumed to be positive.

Parameters
leftleft operand
rightright operand
thresholdsa vector of thresholds whose elements are used when checking equality of corresponding elements of the left and right vectors
lengthspecifies the lengths of all vectors
Returns
: the result of comparison

Definition at line 29 of file TestAsserter.cpp.

◆ isApproxEqual() [3/4]

bool yarp::robottestingframework::TestAsserter::isApproxEqual ( const yarp::sig::Vector left,
const yarp::sig::Vector right,
const yarp::sig::Vector thresholds 
)
static

Element-wise compare two vectors to determine if they are approximately equal, according to a threshold.

The threshold is assumed to be positive.

Parameters
leftleft operand
rightright operand
thresholdsa vector of thresholds whose elements are used when checking equality of corresponding elements of the left and right vectors
Returns
: the result of comparison

Definition at line 54 of file TestAsserter.cpp.

◆ isApproxEqual() [4/4]

bool yarp::robottestingframework::TestAsserter::isApproxEqual ( double  left,
double  right,
double  l_th,
double  h_th 
)
static

Compare two scalars to determine if they are approximately equal, according to asymmetric thresholds that specify upper and lower bound.

Parameters
leftleft operand
rightright operand
l_thlower bound of interval for comparison
h_thupper bound of interval for comparison
Returns
: the result of comparison

Definition at line 65 of file TestAsserter.cpp.


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