![]() |
Lumiera 0.pre.04
»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.
Classes | |
| struct | Meta |
Static Public Member Functions | |
| static void | reseed () |
| discard all cached testData and recalibrate data generation | |
| static bool | isAlive (void *memLocation) |
| Helper to verify that a given memory location holds an active TestFrame instance (created, not yet destroyed) | |
| static bool | isDead (void *memLocation) |
| Helper to verify a given memory location holds an already destroyed TestFrame instance. | |
Public Member Functions | |
| ~TestFrame () | |
| TestFrame (uint seq=0, uint family=0) | |
| TestFrame (TestFrame const &) | |
| TestFrame & | operator= (TestFrame const &) |
| HashVal | markChecksum () |
| recompute and store checksum based on current contents | |
| HashVal | getChecksum () |
| access current checksum without recomputing. | |
| bool | isAlive () const |
| bool | isDead () const |
| bool | isSane () const |
| bool | isValid () const |
| bool | isPristine () const |
| bool | operator== (void *memLocation) const |
| _Arr & | data () |
| Array-style direct access to the payload data. | |
| _Arr const & | data () const |
| _A64 & | data64 () |
| _A64 const & | data64 () const |
Friends | |
| bool | operator== (TestFrame const &f1, TestFrame const &f2) |
| bool | operator!= (TestFrame const &f1, TestFrame const &f2) |
Private Types | |
| enum | StageOfLife { CREATED , EMITTED , DISCARDED } |
| using | _Arr = std::array< char, BUFFSIZ > |
| using | _A64 = std::array< uint64_t, BUFFSIZ/sizeof(uint64_t)> |
Private Member Functions | |
| void | buildData () |
| Generate baseline data content based on the Meta::distinction seed. | |
| Meta & | accessHeader () |
| Meta const & | accessHeader () const |
| bool | contentEquals (TestFrame const &o) const |
| bool | matchDistinction () const |
| verify the current data was not touched since initialisation | |
| StageOfLife | currStage () const |
| HashVal | computeChecksum () const |
| bool | hasValidChecksum () const |
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 |
| ~TestFrame | ( | ) |
Definition at line 223 of file testframe.cpp.
References TestFrame::DISCARDED, TestFrame::header_, and TestFrame::Meta::stage.
Definition at line 229 of file testframe.cpp.
References TestFrame::buildData(), TestFrame::CREATED, TestFrame::Meta::distinction, TestFrame::header_, TestFrame::isPristine(), and TestFrame::Meta::stage.
Here is the call graph for this function:Definition at line 238 of file testframe.cpp.
References TestFrame::CREATED, TestFrame::data(), TestFrame::header_, and TestFrame::Meta::stage.
Here is the call graph for this function:Definition at line 75 of file testframe.hpp.
Definition at line 76 of file testframe.hpp.
|
private |
| Enumerator | |
|---|---|
| CREATED | |
| EMITTED | |
| DISCARDED | |
Definition at line 70 of file testframe.hpp.
|
static |
discard all cached testData and recalibrate data generation
Definition at line 204 of file testframe.cpp.
References lib::defaultGen.
Referenced by NodeDevel_test::run(), OutputProxyProvider_test::run(), TestFrame_test::run(), and TestFrame_test::useFrameTable().
Here is the caller graph for this function:Definition at line 246 of file testframe.cpp.
References TestFrame::CREATED, TestFrame::data(), TestFrame::header_, TestFrame::isAlive(), util::isSameAdr(), and TestFrame::Meta::stage.
Here is the call graph for this function:| HashVal markChecksum | ( | ) |
recompute and store checksum based on current contents
Definition at line 364 of file testframe.cpp.
References TestFrame::accessHeader(), TestFrame::Meta::checksum, and TestFrame::computeChecksum().
Referenced by TestFrame::buildData(), steam::engine::test::ont::combineFrames(), steam::engine::test::ont::manipulateFrame(), TestFrame_test::simpleUsage(), and TestFrame_test::verifyDataContent().
Here is the call graph for this function:
Here is the caller graph for this function:| HashVal getChecksum | ( | ) |
access current checksum without recomputing.
Definition at line 370 of file testframe.cpp.
References TestFrame::accessHeader(), and TestFrame::Meta::checksum.
Referenced by NodeLink_test::trigger_node_port_invocation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Helper to verify that a given memory location holds an active TestFrame instance (created, not yet destroyed)
Definition at line 421 of file testframe.cpp.
References TestFrame::isAlive().
Referenced by TestFrame::isAlive(), TestFrame_test::verifyDataContent(), and BufferProviderProtocol_test::verifyObjectAttachment().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Helper to verify a given memory location holds an already destroyed TestFrame instance.
Definition at line 428 of file testframe.cpp.
References TestFrame::isDead().
Referenced by TestFrame::isDead(), and BufferProviderProtocol_test::verifyObjectAttachment().
Here is the call graph for this function:
Here is the caller graph for this function:| bool isAlive | ( | ) | const |
Definition at line 402 of file testframe.cpp.
References TestFrame::isDead(), and TestFrame::isSane().
Referenced by TestFrame::operator=(), TestFrame_test::verifyFrameLifecycle(), and BufferMetadata_test::verifyStandardCase().
Here is the call graph for this function:
Here is the caller graph for this function:| bool isDead | ( | ) | const |
Definition at line 409 of file testframe.cpp.
References TestFrame::currStage(), TestFrame::DISCARDED, and TestFrame::isSane().
Referenced by TestFrame::isAlive(), TestFrame_test::verifyFrameLifecycle(), and BufferMetadata_test::verifyStandardCase().
Here is the call graph for this function:
Here is the caller graph for this function:| bool isSane | ( | ) | const |
Definition at line 382 of file testframe.cpp.
References TestFrame::header_, and TestFrame::Meta::isPlausible().
Referenced by TestFrame::isAlive(), TestFrame::isDead(), TestFrame::isValid(), TestFrame::operator==(), TrackingHeapBlockProvider_test::simpleExample(), NodeDevel_test::testRand_simpleUsage(), TestFrame_test::verifyDataContent(), and BufferProviderProtocol_test::verifyObjectAttachment().
Here is the call graph for this function:
Here is the caller graph for this function:| bool isValid | ( | ) | const |
Definition at line 388 of file testframe.cpp.
References TestFrame::hasValidChecksum(), and TestFrame::isSane().
Referenced by TestFrame::isPristine(), OutputProxyProvider_test::run(), TestFrame_test::simpleUsage(), NodeDevel_test::testRand_buildFilterNode(), NodeDevel_test::testRand_buildMixNode(), NodeLink_test::trigger_node_port_invocation(), and TestFrame_test::verifyDataContent().
Here is the call graph for this function:
Here is the caller graph for this function:| bool isPristine | ( | ) | const |
Definition at line 395 of file testframe.cpp.
References TestFrame::isValid(), and TestFrame::matchDistinction().
Referenced by TestFrame::TestFrame(), OutputProxyProvider_test::run(), NodeDevel_test::testRand_buildFilterNode(), NodeDevel_test::testRand_simpleUsage(), NodeLink_test::trigger_node_port_invocation(), TestFrame_test::useFrameTable(), and TestFrame_test::verifyDataContent().
Here is the call graph for this function:
Here is the caller graph for this function:| bool operator== | ( | void * | memLocation | ) | const |
Definition at line 307 of file testframe.cpp.
References TestFrame::isSane().
Here is the call graph for this function:
|
inline |
Array-style direct access to the payload data.
Definition at line 133 of file testframe.hpp.
References TestFrame::buffer_.
Referenced by TestFrame::TestFrame(), steam::engine::test::ont::combineFrames(), TestFrame::computeChecksum(), TestFrame::contentEquals(), TestFrame::operator=(), TestFrame_test::simpleUsage(), TestFrame_test::useFrameTable(), and TestFrame_test::verifyDataContent().
Here is the caller graph for this function:
|
inline |
Definition at line 134 of file testframe.hpp.
References TestFrame::buffer_.
|
inline |
Definition at line 135 of file testframe.hpp.
References TestFrame::buffer_.
Referenced by TestFrame::buildData(), steam::engine::test::ont::manipulateFrame(), steam::engine::test::ont::manipulateMultichan(), TestFrame::matchDistinction(), and TestFrame_test::verifyDataContent().
Here is the caller graph for this function:
|
inline |
Definition at line 136 of file testframe.hpp.
References TestFrame::buffer_.
|
private |
Generate baseline data content based on the Meta::distinction seed.
Definition at line 330 of file testframe.cpp.
References TestFrame::accessHeader(), TestFrame::data64(), and TestFrame::markChecksum().
Referenced by TestFrame::TestFrame().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 278 of file testframe.cpp.
References TestFrame::header_, and TestFrame::Meta::isPlausible().
Referenced by TestFrame::buildData(), TestFrame::getChecksum(), TestFrame::hasValidChecksum(), TestFrame::markChecksum(), and TestFrame::matchDistinction().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 285 of file testframe.cpp.
|
private |
Definition at line 315 of file testframe.cpp.
References TestFrame::data().
Here is the call graph for this function:
|
private |
verify the current data was not touched since initialisation
Definition at line 342 of file testframe.cpp.
References TestFrame::accessHeader(), and TestFrame::data64().
Referenced by TestFrame::isPristine().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 291 of file testframe.cpp.
References TestFrame::DISCARDED, TestFrame::header_, TestFrame::Meta::isPlausible(), and TestFrame::Meta::stage.
Referenced by TestFrame::isDead().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 353 of file testframe.cpp.
References lib::hash::combine(), and TestFrame::data().
Referenced by TestFrame::hasValidChecksum(), and TestFrame::markChecksum().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 376 of file testframe.cpp.
References TestFrame::accessHeader(), TestFrame::Meta::checksum, and TestFrame::computeChecksum().
Referenced by TestFrame::isValid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticconstexprprivate |
Definition at line 74 of file testframe.hpp.
|
private |
inline storage buffer for the payload media data
Definition at line 92 of file testframe.hpp.
Referenced by TestFrame::data(), TestFrame::data(), TestFrame::data64(), and TestFrame::data64().
|
private |
Metadata record located behind the data buffer.
Definition at line 95 of file testframe.hpp.
Referenced by TestFrame::TestFrame(), TestFrame::TestFrame(), TestFrame::~TestFrame(), TestFrame::accessHeader(), TestFrame::currStage(), TestFrame::isSane(), and TestFrame::operator=().
Definition at line 129 of file testframe.hpp.
Definition at line 130 of file testframe.hpp.
Collaboration diagram for TestFrame: