108 : distinction_{anchor}
123 | 0b1000'1000'1000'1000'1000'1000'1000'1000;
139 REQUIRE (memoryLocation);
140 return *
reinterpret_cast<TestFrame*
> (memoryLocation);
154 : deque<deque<TestFrame>>
161 if (chanNr >= this->size())
163 ENSURE (chanNr < this->size());
164 deque<TestFrame>& channel = at(chanNr);
166 if (seqNr >= channel.size())
168 INFO (
test,
"Growing channel #%d of test frames %d -> %d elements."
169 , chanNr, channel.size(), seqNr+1);
170 for (
uint nr=channel.size(); nr<=seqNr; ++nr)
171 channel.emplace_back (nr, chanNr);
173 ENSURE (seqNr < channel.size());
174 return channel[seqNr];
189 testFrames = std::make_unique<TestFrameTable>();
190 return testFrames->getFrame (seqNr, chanNr);
217 : _MARK_{stampHeader()}
219 , distinction{generateDiscriminator (seq,family)}
249 throw err::Logic (
"target TestFrame already dead or unaccessible");
273 return _MARK_ == stampHeader()
281 throw err::Invalid{
"TestFrame: missing or corrupted metadata"};
287 return unConst(
this)->accessHeader();
309 TestFrame& candidate (accessAsTestFrame (memLocation));
311 and candidate == *
this;
332 auto gen = buildDataGenFrom (
accessHeader().distinction);
333 for (uint64_t& dat :
data64())
344 auto gen = buildDataGenFrom (
accessHeader().distinction);
345 for (uint64_t
const& dat :
data64())
346 if (dat != gen.u64())
357 for (
char const& dat :
data())
423 TestFrame& candidate (accessAsTestFrame (memLocation));
430 TestFrame& candidate (accessAsTestFrame (memLocation));
431 return candidate.
isDead();
Access point to a selection of random number sources.
HashVal hash()
non-zero hash value from full 64bit range
auto distribute(DIST)
generic adapter: draw next number to use the given distribution
Establishes a seed point for any instance or performance.
Derived specific exceptions within Lumiera's exception hierarchy.
Mock data frame for simulated rendering.
void buildData()
Generate baseline data content based on the Meta::distinction seed.
HashVal getChecksum()
access current checksum without recomputing.
bool matchDistinction() const
verify the current data was not touched since initialisation
HashVal computeChecksum() const
static bool isDead(void *memLocation)
Helper to verify a given memory location holds an already destroyed TestFrame instance.
StageOfLife currStage() const
HashVal markChecksum()
recompute and store checksum based on current contents
TestFrame & operator=(TestFrame const &)
friend bool operator==(TestFrame const &f1, TestFrame const &f2)
TestFrame(uint seq=0, uint family=0)
_Arr & data()
Array-style direct access to the payload data.
static bool isAlive(void *memLocation)
Helper to verify that a given memory location holds an active TestFrame instance (created,...
Meta header_
Metadata record located behind the data buffer.
bool hasValidChecksum() const
static void reseed()
discard all cached testData and recalibrate data generation
bool contentEquals(TestFrame const &o) const
uint64_t getSeed() override
uint64_t const & distinction_
DistinctNucleus(uint64_t const &anchor)
Types marked with this mix-in may be moved but not copied.
Lumiera error handling (C++ interface).
Hash combine function extracted from LibBoost 1.67 Combine two hash values to form a composite depend...
Helper to use a single extension point for specialised hash functions.
void combine(size_t &combinedHash, size_t additionalHash)
meld the additional hash value into the given base hash value.
Random entropyGen
a global RandomSequencer seeded with real entropy
Random defaultGen
a global default RandomSequencer for mundane purposes
LumieraError< LERR_(LOGIC)> Logic
Lumiera GTK UI implementation root.
HashVal drawSeed(lib::Random &srcGen)
uint64_t generateDiscriminator(uint seq, uint family)
const size_t SEQUENCE_SPREAD
Offset to set the seed values of »families« apart.
auto buildDataGenFrom(uint64_t const &anchor)
std::unique_ptr< TestFrameTable > testFrames
TestFrame & accessAsTestFrame(void *memoryLocation)
TestFrame & testData(uint seqNr, uint chanNr)
Helper to access a specific frame of test data at a fixed memory location.
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
bool isSameAdr(A const &a, B const &b)
compare plain object address identity, disregarding type.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Generating (pseudo) random numbers with controlled seed.
Primary class template for std::hash.
Unit test helper to generate fake test data frames.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...