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

Defines a data generator that produce value within an interval. More...

#include <tts/test/generator.hpp>

Detailed Description

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

Defines a data generator that produce value within an interval.

Example

#define TTS_MAIN
#include <tts/tts.hpp>
#include <array>
TTS_CASE_WITH ( "Check behavior for interval generator"
, (std::array<int,7>)
)
(auto data)
{
TTS_EQUAL(data[0],-3);
TTS_EQUAL(data[1],-2);
TTS_EQUAL(data[2],-1);
TTS_EQUAL(data[3],0);
TTS_EQUAL(data[4],1);
TTS_EQUAL(data[5],2);
TTS_EQUAL(data[6],3);
};
#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 value within an interval.
Definition: generator.hpp:233

Public Member Functions

 between (T s, U st)
 Define the interval for the generator.