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

◆ TTS_ALL_RELATIVE_EQUAL

#define TTS_ALL_RELATIVE_EQUAL (   L,
  R,
  N,
  ... 
)    TTS_ALL(L,R, ::tts::relative_distance,N,"%" , __VA_ARGS__ )

Checks if all elements of two sequences are within a given relative percentage and that their sizes are equal.

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

Parameters
L,RSequences to compare.
NMaximum relative percentage 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>
#include <vector>
#include <list>
TTS_CASE("Relative distance over sequences")
{
std::vector v{1.f,2.f,3.f,-5.f};
std::list w{1.f,2.f,3.1f,-5.f};
};
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147
#define TTS_ALL_RELATIVE_EQUAL(L, R, N,...)
Checks if all elements of two sequences are within a given relative percentage and that their sizes a...
Definition: sequence.hpp:140