Lumiera
0.pre.03
»edit your freedom«
|
#include "/Werk/devel/lumi/tests/core/steam/engine/testframe.hpp"
Mock data frame for simulated rendering.
A test frame can be created and placed instead of a real data frame. It doesn't depend on any external libraries and will be self-maintaining. Placeholder functions are provided for assignment (simulating the actual calculations); additional diagnostic functions allow to verify the performed operations after-the fact
Each TestFrame is automatically filled with pseudo random data; multiple frames are arranged in sequences and channels, causing the random data to be reproducible yet different within each frame. TestFrame's lifecycle is tracked and marked in an embedded state field. Moreover, the contents of the data block can be verified, because the sequence of bytes is reproducible, based on the channel and sequence number of the test frame.
Definition at line 68 of file testframe.hpp.
Public Member Functions | |
TestFrame (uint seq=0, uint family=0) | |
TestFrame (TestFrame const &) | |
_Arr & | data () |
Array-style direct access to the payload data. | |
_Arr const & | data () const |
_A64 & | data64 () |
_A64 const & | data64 () const |
bool | isAlive () const |
bool | isDead () const |
bool | isPristine () const |
bool | isSane () const |
bool | isValid () const |
HashVal | markChecksum () |
recompute and store checksum based on current contents More... | |
TestFrame & | operator= (TestFrame const &) |
bool | operator== (void *memLocation) const |
Static Public Member Functions | |
static bool | isAlive (void *memLocation) |
Helper to verify that a given memory location holds an active TestFrame instance (created, not yet destroyed) More... | |
static bool | isDead (void *memLocation) |
Helper to verify a given memory location holds an already destroyed TestFrame instance. | |
static void | reseed () |
discard all cached #testData and recalibrate data generation More... | |
Classes | |
struct | Meta |
Friends | |
bool | operator!= (TestFrame const &f1, TestFrame const &f2) |
bool | operator== (TestFrame const &f1, TestFrame const &f2) |
Private Types | |
using | _A64 = std::array< uint64_t, BUFFSIZ/sizeof(uint64_t)> |
using | _Arr = std::array< char, BUFFSIZ > |
enum | StageOfLife { CREATED, EMITTED, DISCARDED } |
Private Member Functions | |
Meta & | accessHeader () |
Meta const & | accessHeader () const |
void | buildData () |
Generate baseline data content based on the Meta::distinction seed. More... | |
HashVal | computeChecksum () const |
bool | contentEquals (TestFrame const &o) const |
StageOfLife | currStage () const |
bool | hasValidChecksum () const |
bool | matchDistinction () const |
verify the current data was not touched since initialisation More... | |
Private Attributes | |
std::byte | buffer_ [sizeof(_Arr)] |
inline storage buffer for the payload media data | |
Meta | header_ |
Metadata record located behind the data buffer. | |
Static Private Attributes | |
static constexpr size_t | BUFFSIZ = 1024 |
|
static |
discard all cached #testData and recalibrate data generation
Definition at line 204 of file testframe.cpp.
HashVal markChecksum | ( | ) |
recompute and store checksum based on current contents
Definition at line 364 of file testframe.cpp.
Referenced by steam::engine::test::combineFrames(), and steam::engine::test::manipulateFrame().
|
static |
Helper to verify that a given memory location holds an active TestFrame instance (created, not yet destroyed)
Definition at line 416 of file testframe.cpp.
|
private |
Generate baseline data content based on the Meta::distinction seed.
Definition at line 330 of file testframe.cpp.
Referenced by TestFrame::data().
|
private |
verify the current data was not touched since initialisation
Definition at line 342 of file testframe.cpp.
Referenced by TestFrame::data().
|
private |
Definition at line 353 of file testframe.cpp.
Referenced by TestFrame::data().