RobWorkProject  23.9.11-
Public Member Functions | Public Attributes | List of all members
EngineTest::Result Struct Reference

A result of an engine test. Each test can return multiple results. More...

#include <EngineTest.hpp>

Public Member Functions

 Result (const std::string &name, const std::string &description)
 Construct a new result. More...
 
void addValue (double time, double val)
 Add a value to the result. More...
 
void addValues (double time, const rw::math::Q &vals)
 Add multiple values to the result. More...
 
void checkLastValues (double expected, double eps=std::numeric_limits< double >::epsilon())
 Check if the latest added value was as expected and add a failure if not. More...
 
void checkLastValuesBetween (double expectedLow, double expectedHigh, double eps=std::numeric_limits< double >::epsilon())
 Check if the latest added value was in expected range, [expectedLow; expectedHigh ], and add a failure if not. More...
 

Public Attributes

std::string name
 Name of the result.
 
std::string description
 Description of result.
 
rw::trajectory::TimedQPath values
 The timed values recorded during simulation.
 
std::list< Failurefailures
 A list of failures for this result.
 

Detailed Description

A result of an engine test. Each test can return multiple results.

Constructor & Destructor Documentation

◆ Result()

Result ( const std::string &  name,
const std::string &  description 
)

Construct a new result.

Parameters
name[in] name of the result.
description[in] description of the result.

Member Function Documentation

◆ addValue()

void addValue ( double  time,
double  val 
)

Add a value to the result.

Parameters
time[in] simulation time.
val[in] the value to record.

◆ addValues()

void addValues ( double  time,
const rw::math::Q vals 
)

Add multiple values to the result.

Parameters
time[in] simulation time.
vals[in] the values to record.

◆ checkLastValues()

void checkLastValues ( double  expected,
double  eps = std::numeric_limits< double >::epsilon() 
)

Check if the latest added value was as expected and add a failure if not.

Parameters
expected[in] the expected value.
eps[in] (optional) the tolerance.
Note
For Q values with 2 or more values, these are compared to the same expected value.

◆ checkLastValuesBetween()

void checkLastValuesBetween ( double  expectedLow,
double  expectedHigh,
double  eps = std::numeric_limits< double >::epsilon() 
)

Check if the latest added value was in expected range, [expectedLow; expectedHigh ], and add a failure if not.

Parameters
expectedLow[in] lower bound.
expectedHigh[in] higher bound.
eps[in] (optional) the tolerance.
Note
For Q values with 2 or more values, these are compared to the same values.

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