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

◆ TTS_LESS_EQUAL

#define TTS_LESS_EQUAL (   LHS,
  RHS,
  ... 
)    TTS_RELATION(LHS,RHS, le , "<=" , ">" , __VA_ARGS__)

Performs less-or-equal-than comparison between two expressions.

This comparison is performed by using the proper operator< overload or by a custom comparison.

Parameters
LHS,RHSExpressions to compare.
...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>
TTS_CASE( "Check correctness of less-than comparison tests" )
{
TTS_LESS_EQUAL(42., 69);
TTS_LESS_EQUAL(69., 69);
std::vector<float> a{1,2,3}, b{7,9};
// This test would cause the program to stop with a failure
// TTS_LESS_EQUAL(10., 1., REQUIRED);
};
#define TTS_CASE(ID)
Introduces a new test scenario and registers it into the current test driver.
Definition: case.hpp:147
#define TTS_LESS_EQUAL(LHS, RHS,...)
Performs less-or-equal-than comparison between two expressions.
Definition: relation.hpp:223