template<typename T>
struct tts::limits_set< T >
Defines a set of limits for a type T.
This structure provides a set of limits and special values for the type T that can be used for generating test data that covers edge cases and special values. The actual limits provided depend on the type T and its base type.
The provided limits include:
- valmax: The maximum representable value of the base type.
- valmin: The minimum representable value of the base type.
- zero: The value representing zero.
- one: The value representing one.
For floating-point types, additional limits include:
- nan: Not-a-Number value.
- inf: Positive infinity.
- minf: Negative infinity.
- maxflint: The largest integer value that can be exactly represented in the type.
- mindenormal: The smallest positive subnormal value.
- smallestposval: The smallest positive normal value.
- mzero: Negative zero.
- mone: The value representing negative one.
This class can be specialized for user-defined types to provide custom limits.
#define TTS_MAIN
#include <tts/tts.hpp>
{
TTS_EQUAL(l.inf, std::numeric_limits<float>::infinity());
TTS_EQUAL(l.valmax, std::numeric_limits<float>::max());
TTS_EQUAL(l.valmin, std::numeric_limits<float>::lowest());
TTS_EQUAL(l.maxflint,
static_cast<float>(1u << std::numeric_limits<float>::digits));
};
- Template Parameters
-
| T | Type for which to provide limits for. |