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

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

#include <tts/test/generator.hpp>

Detailed Description

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

Defines a data generator that produce a ramp of data.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
#include <array>
TTS_CASE_WITH ( "Check behavior for ramp generator"
, (std::array<int,4>)
)
(auto ramp1, auto ramp2)
{
for(int i=0;i<ramp1.size();++i)
TTS_EQUAL(ramp1[i],65+i);
for(int i=0;i<ramp2.size();++i)
TTS_EQUAL(ramp2[i],1+i*2);
};
#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 ramp of data.
Definition: generator.hpp:141

Public Member Functions

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