Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Implementation of fake data frames to support unit testing.
The data generation is based on a discriminator seed value, which is computed as a linear combination of a statically fixed anchor-seed combined with the family-number and sequence number. Based on this seed, the contents are then filled by a pseudo-random sequence.
Additionally, beyond this basic test-data feature, the contents can be manipulated freely, and a new checksum can be stored in the metadata, which allows to build pseudo media computation functions with a reproducible effect — so that the proper invocation of several computation steps invoked deep down in the render engine can be verified after completing a test invocation.
Definition in file testframe.cpp.
#include "lib/error.hpp"
#include "lib/random.hpp"
#include "lib/hash-standard.hpp"
#include "lib/hash-combine.hpp"
#include "steam/engine/testframe.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <climits>
#include <memory>
#include <deque>
Classes | |
class | DistinctNucleus |
struct | TestFrameTable |
Typedefs | |
using | PseudoRandom = lib::RandomSequencer< std::minstd_rand > |
Functions | |
TestFrame & | accessAsTestFrame (void *memoryLocation) |
auto | buildDataGenFrom (uint64_t const &anchor) |
HashVal | drawSeed (lib::Random &srcGen) |
uint64_t | generateDiscriminator (uint seq, uint family) |
HashVal | stampHeader () |
TestFrame & | testData (uint seqNr=0, uint chanNr=0) |
Helper to access a specific frame of test data at a fixed memory location. More... | |
Variables | |
HashVal | dataSeed {drawSeed(lib::entropyGen)} |
const size_t | SEQUENCE_SPREAD = 100 |
Offset to set the seed values of »families« apart. More... | |
std::unique_ptr< TestFrameTable > | testFrames |
Namespaces | |
steam | |
Steam-Layer implementation namespace root. | |
steam::engine | |
Lumiera's render engine core and operational control. | |
using PseudoRandom = lib::RandomSequencer<std::minstd_rand> |
Definition at line 57 of file testframe.cpp.
TestFrame & testData | ( | uint | seqNr = 0 , |
uint | chanNr = 0 |
||
) |
Helper to access a specific frame of test data at a fixed memory location.
The series of test frames is generated on demand, but remains in memory thereafter, similar to real data accessible from some kind of source stream. Each of these generated test frames is filled with different yet reproducible pseudo random data. Client code is free to access and corrupt this data.
defaultGen
Definition at line 186 of file testframe.cpp.
Referenced by TestFrame::data(), and TestFrame_test::useFrameTable().