Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
testframe.hpp File Reference

Unit test helper to generate fake test data frames. More...

Go to the source code of this file.

Description

Unit test helper to generate fake test data frames.

Each TestFrame holds a 1k buffer of byte data, which can be verified, accessed and manipulated to emulate media computations. A metadata header is placed in memory behind the working buffer, which allows to detect data corruption and stores a lifecycle phase and a data checksum.

The contents of each TestFrame are filled on creation with pseudo-random data, which is created from a discriminator seed, based on a »family« and a »frameNr« within each family(≙channel). Due to the deterministic nature of these computations, the pristine state of any frame can be determined. But the payload data is accessible and can be manipulated, and a new checksum can be recorded.

For ease of testing, a static store of TestFrame instances is built and retained in heap memory, and an arbitrary memory location can be treated as TestFrame.

Definition in file testframe.hpp.

#include "lib/integral.hpp"
#include "lib/hash-value.h"
#include <array>

Namespaces

namespace  steam
 Steam-Layer implementation namespace root.
 
namespace  steam::engine
 Lumiera's render engine core and operational control.
 
namespace  steam::engine::test
 

Classes

class  TestFrame
 Mock data frame for simulated rendering. More...
 
struct  TestFrame::Meta
 

Functions

TestFrametestData (uint seqNr=0, uint chanNr=0)
 Helper to access a specific frame of test data at a fixed memory location.