TTS v4.1.0
The Tiny Test System
Loading...
Searching...
No Matches
tts::as_signed_integer< G > Struct Template Reference

Adapts a generator to produce signed integer values. More...

Detailed Description

template<typename G>
struct tts::as_signed_integer< G >

Adapts a generator to produce signed integer values.

Calls the adapted generator, given at construction, for the signed integer type as wide as the base type of the target type, element by element for a sequence. The values are integers drawn by that generator, in place of values of the target type.

Example

#define TTS_MAIN // No need for main()
#include <tts/tts.hpp>
TTS_CASE_WITH("Test tts::ramp generator",
(float, double),
tts::randoms {-10, 10}
})
<typename T>(T value)
{
TTS_EXPECT(std::is_integral_v<decltype(value)>);
TTS_EXPECT(std::is_signed_v<decltype(value)>);
TTS_LESS_EQUAL(value, T {10});
TTS_GREATER_EQUAL(value, T {-10});
};
Template Parameters
GType of the generator to adapt