tts v2.3.0
The Tiny Test System
 
Loading...
Searching...
No Matches
tts::reverse_ramp< T, U > Struct Template Reference

Defines a data generator that produce a reversed ramp of data. More...

#include <tts/test/generator.hpp>

Detailed Description

template<typename T, typename U = T>
struct tts::reverse_ramp< T, U >

Defines a data generator that produce a reversed ramp of data.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
#include <array>
TTS_CASE_WITH ( "Check behavior for reverse_ramp generator"
, (std::array<int,4>)
)
(auto ramp1, auto ramp2)
{
TTS_EQUAL(ramp1[0],3);
TTS_EQUAL(ramp1[1],2);
TTS_EQUAL(ramp1[2],1);
TTS_EQUAL(ramp1[3],0);
TTS_EQUAL(ramp2[0],16);
TTS_EQUAL(ramp2[1],14);
TTS_EQUAL(ramp2[2],12);
TTS_EQUAL(ramp2[3],10);
};
#define TTS_CASE_WITH(ID, TYPES, GENERATOR)
Introduces a template test case providing dynamically generated data to the test code.
Definition: case.hpp:258
auto generate(G... g)
Build a data generator.
Definition: generator.hpp:76
#define TTS_EQUAL(LHS, RHS,...)
Performs equality comparison between two expressions.
Definition: relation.hpp:90
Defines a data generator that produce a reversed ramp of data.
Definition: generator.hpp:188

Public Member Functions

 reverse_ramp (T s)
 Define a reversed ramp with a final value and an unit step.
 
 reverse_ramp (T s, U st)
 Define a reversed ramp with a final value and a custom step.