tts v2.3.0
The Tiny Test System
 
Loading...
Searching...
No Matches

◆ TTS_ABSOLUTE_EQUAL

#define TTS_ABSOLUTE_EQUAL (   L,
  R,
  N,
  ... 
)    TTS_PRECISION(L,R,N,"unit", ::tts::absolute_distance, 8, __VA_ARGS__ )

Checks if the absolute distance between values is less or equal to a threshold.

This comparison is performed by using the proper tts::absolute_distance overload.

Parameters
L,RExpressions to compare.
NMaximum absolute distance accepted between L and R.
...Optional tag. If equals to REQUIRED, this test will stop the program if it fails.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
TTS_CASE("Absolute distance")
{
TTS_ABSOLUTE_EQUAL(-2. , 2.f , 4.);
TTS_ABSOLUTE_EQUAL('A' , 80LL , 15, REQUIRED);
};
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147
#define TTS_ABSOLUTE_EQUAL(L, R, N,...)
Checks if the absolute distance between values is less or equal to a threshold.
Definition: precision.hpp:71