Lumiera
0.pre.03
»edit your freedom«
|
#include "/Werk/devel/lumi/tests/core/steam/engine/mock-dispatcher.hpp"
Mock setup for a JobTicket to generate dummy render Job invocations.
Implemented as subclass, it provides a specification DSL for tests, and is able to probe some otherwise opaque internals of JobTicket. Beyond that, MockJobTicket has the same storage size; and behaves like the regular JobTicket after construction – but any Job created by JobTicket::createJobFor(nominalTime) will be wired with the MockJob functor and can thus be related back to the test specification setup.
Definition at line 143 of file mock-dispatcher.hpp.
Public Member Functions | |
MockJobTicket (HashVal seed) | |
bool | verify_associated (Job const &) const |
verify the given job instance was actually generated from this JobTicket. More... | |
Public Member Functions inherited from JobTicket | |
template<class ALO > | |
JobTicket (ExitNode const &exitNode, ALO &allocator) | |
Job | createJobFor (Time nominalTime) |
Core operation: build a concrete render job based on this blueprint. More... | |
bool | empty () const |
Duration | getExpectedRuntime () |
Core operation: guess expected runtime for rendering. More... | |
auto | getPrerequisites () |
Core operation: iterate over the prerequisites, required to carry out a render operation based on this blueprint. More... | |
bool | isValid () const |
Static Public Member Functions | |
static bool | isAssociated (Job const &, JobTicket const &) |
convenience shortcut to perform this test on arbitrary JobTicket and Job instances. More... | |
Private Member Functions | |
auto & | allocator () |
Private Member Functions inherited from AllocatorHandle< JobTicket > | |
~AllocatorHandle () | |
JobTicket & | operator() (ARGS &&...args) |
Static Private Member Functions | |
static ExitNode | defineSimpleSpec (HashVal seed=1+rand()) |
provide a test specification wired to MockJob | |
Additional Inherited Members | |
Static Public Attributes inherited from JobTicket | |
static JobTicket | NOP {} |
special »do nothing« JobTicket marker | |
Protected Member Functions inherited from JobTicket | |
bool | verifyInstance (JobFunctor &, InvocationInstanceID const &, Time) const |
Helper for tests: verify the given invocation parameters match this JobTicket. | |
Static Protected Member Functions inherited from JobTicket | |
static InvocationInstanceID | timeHash (Time, InvocationInstanceID const &) |
Tag the precomputed invocation ID with the nominal frame time. | |
|
inline |
verify the given job instance was actually generated from this JobTicket.
Definition at line 291 of file mock-dispatcher.hpp.
Referenced by MockJobTicket::isAssociated().
convenience shortcut to perform this test on arbitrary JobTicket and Job instances.
Definition at line 307 of file mock-dispatcher.hpp.
References MockJobTicket::verify_associated().