TTS v4.1.0
The Tiny Test System
Loading...
Searching...
No Matches

Generates random bit patterns. More...

Detailed Description

Generates random bit patterns.

Each value is an unsigned integer as wide as the base type of the target type, drawn uniformly over all its values, and std::bit_cast reads its bits as a target value. A sequence target gets one such integer per element.

Example

#define TTS_MAIN // No need for main()
#include <tts/tts.hpp>
TTS_CASE_WITH("random bits generator example", tts::arithmetic_types, tts::random_bits {})
<typename T>(T)
{
TTS_EXPECT(std::is_unsigned_v<T>);
};