Lumiera  0.pre.03
»edit your freedom«
TestFrame Class Reference

#include "/Werk/devel/lumi/tests/core/steam/engine/testframe.hpp"

Description

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.

See also
TestFrame_test
OutputSlotProtocol_test

Definition at line 60 of file testframe.hpp.

Public Member Functions

 TestFrame (uint seq=0, uint family=0)
 
 TestFrame (TestFrame const &)
 
bool isAlive () const
 
bool isDead () const
 
bool isSane () const
 
TestFrameoperator= (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.
 

Friends

bool operator!= (TestFrame const &f1, TestFrame const &f2)
 
bool operator== (TestFrame const &f1, TestFrame const &f2)
 

Private Types

enum  StageOfLife {
  CREATED,
  EMITTED,
  DISCARDED
}
 

Private Member Functions

void buildData ()
 
bool contentEquals (TestFrame const &o) const
 
bool verifyData () const
 

Private Attributes

char data_ [BUFFSIZ]
 
uint64_t distinction_
 
StageOfLife stage_
 

Static Private Attributes

static const size_t BUFFSIZ = 1024
 

Member Function Documentation

◆ isAlive()

bool isAlive ( void *  memLocation)
static

Helper to verify that a given memory location holds an active TestFrame instance (created, not yet destroyed)

Returns
true if the TestFrame datastructure is intact and marked as still alive.
Note
performing an unchecked conversion of the given memory location to be accessed as TestFrame. The sanity of the data found at that location is checked as well, not only the lifecycle flag.

Definition at line 221 of file testframe.cpp.

+ Collaboration diagram for TestFrame:

The documentation for this class was generated from the following files: