79 CHECK (3 == mockSegs.size());
98 Time nominalTime = lib::test::randTime();
99 int additionalKey = rani(5000);
100 MockJob mockJob{nominalTime, additionalKey};
101 CHECK (mockJob.getNominalTime() == nominalTime);
104 mockJob.triggerJob();
111 mockJob.triggerJob();
122 auto frameTime = lib::test::randTime();
127 CHECK (nopJob.parameter.nominalTime == frameTime);
133 CHECK (not mockTicket.
empty());
153 Time someTime = lib::test::randTime();
158 CHECK (1 == mockSeg.
size());
159 JobTicket const& ticket = mockSeg[someTime].jobTicket(0);
165 CHECK (1 == mockSegs.size());
166 CHECK (
Time::MIN == mockSegs[someTime].start());
167 CHECK (
Time::MAX == mockSegs[someTime].after());
168 JobTicket& ticket = mockSegs[someTime].jobTicket(0);
172 CHECK (someJob.parameter.nominalTime == someTime);
184 int marker = rani(1000);
191 CHECK (2 == mockSegs.size());
203 CHECK (marker == job.parameter.invoKey.part.a);
215 CHECK (seg1.
empty());
216 CHECK (not seg2.
empty());
220 int marker = rani(1000);
227 CHECK (3 == mockSegs.size());
228 auto const& [s1,s2,s3] = seqTuple<3> (mockSegs.eachSeg());
230 CHECK (not s2.empty());
232 CHECK (isSameObject (s2, mockSegs[
Time{0,10}]));
234 CHECK (
Time(0,10) == s1.after());
235 CHECK (
Time(0,10) == s2.start());
236 CHECK (
Time(0,20) == s2.after());
237 CHECK (
Time(0,20) == s3.start());
240 Job job = s2.jobTicket(0).createJobFor(someTime);
261 CHECK (5 == mockSegs.size());
262 auto const& [s1,s2,s3,s4,s5] = seqTuple<5> (mockSegs.eachSeg());
263 CHECK (not s1.empty());
264 CHECK (not s2.empty());
266 CHECK (not s4.empty());
269 CHECK (-
Time(0,5) == s1.after());
270 CHECK (-
Time(0,5) == s2.start());
271 CHECK (
Time(0, 0) == s2.after());
272 CHECK (
Time(0, 0) == s3.start());
273 CHECK (
Time(0,10) == s3.after());
274 CHECK (
Time(0,10) == s4.start());
275 CHECK (
Time(0,20) == s4.after());
276 CHECK (
Time(0,20) == s5.start());
279 auto probeKey = [&](
Segment const& segment)
281 if (segment.empty())
return 0;
283 Job job = segment.jobTicket(0).createJobFor(someTime);
290 CHECK (2 == probeKey(s1));
291 CHECK (3 == probeKey(s2));
292 CHECK (0 == probeKey(s3));
293 CHECK (1 == probeKey(s4));
294 CHECK (0 == probeKey(s5));
308 Time someTime = lib::test::randTime();
317 CHECK (1 == mockSegs.size());
320 CHECK (not isnil (prereq));
324 CHECK (isnil (prereq));
353 auto start = singleValIterator (mockSegs[
Time::ZERO].jobTicket(0));
363 return ticket.
createJobFor(someTime).parameter.invoKey.part.a;
367 CHECK (
util::join(it,
"-") ==
"11-22-33-44-55"_expect);
390 CHECK (port0 != port1);
391 CHECK (sink0 != sink1);
392 CHECK (port0.isValid());
393 CHECK (port1.isValid());
394 CHECK (sink0.isValid());
395 CHECK (sink1.isValid());
402 Time frameTime{0,30};
403 size_t modelPortIDX = 0;
407 CHECK (dispatcher.
verify(job0, port0, sink0));
408 CHECK (dispatcher.
verify(job1, port1, sink1));
420 size_t modelPortIDX = 1;
421 Job job0 = dispatcher.createJobFor (modelPortIDX,
Time{0,5});
422 Job job1 = dispatcher.createJobFor (modelPortIDX,
Time{0,25});
424 CHECK (11 == job0.parameter.invoKey.part.a);
425 CHECK (22 == job1.parameter.invoKey.part.a);
Mutator && scope(X const &initialiser, ARGS &&...args)
Mutator && attrib(string const &key, X &&initialiser, ARGS &&...args)
Lumiera's internal time value datatype.
Job createJobFor(size_t portIDX, TimeValue nominalTime)
Convenience shortcut for tests: JobTicket ⟼ Job.
execution plan for pulling a specific exit node.
Job createJobFor(Time nominalTime)
Core operation: build a concrete render job based on this blueprint.
static JobTicket NOP
special »do nothing« JobTicket marker
auto getPrerequisites()
Core operation: iterate over the prerequisites, required to carry out a render operation based on thi...
A mocked frame Dispatcher setup without any backing model.
bool verify(Job const &job, ModelPort const &port, play::DataSink const &sink)
Test support: verify the given Job is consistent with this Dispatcher.
size_t resolveModelPort(ModelPort modelPort) override
translate a generic ModelPort spec into the specific index number applicable at the Timeline referred...
play::test::DummyOutputLink getDummyConnection(uint index)
The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink han...
Mock setup for a JobTicket to generate dummy render Job invocations.
bool verify_associated(Job const &) const
verify the given job instance was actually generated from this JobTicket.
static bool isAssociated(Job const &, JobTicket const &)
convenience shortcut to perform this test on arbitrary JobTicket and Job instances.
Mock setup for a render Job with NO action but built-in diagnostics.
static bool was_invoked(Job const &job)
static Time invocationNominalTime(Job const &job)
static int invocationAdditionalKey(Job const &job)
static Time invocationTime(Job const &job)
static bool isNopJob(Job const &)
Mock setup for a complete Segmentation to emulate the structure of the actual fixture,...
void verify_MockSegmentation()
void verify_MockPrerequisites()
void verify_MockJobTicket()
void verify_MockDispatcherSetup()
For the purpose of building and rendering, the fixture (for each timeline) is partitioned such that e...
engine::JobTicket & jobTicket(size_t portNr) const
Access the JobTicket for this segment and the given portNr.
Handle designating a point within the model, where actually output data can be pulled.
denotes an opened connection ready to receive media data for output.
Abstract Base Class for all testcases.
void seedRand()
draw a new random seed from a common nucleus, and re-seed the default-Gen.
static bool wasRecently(Time event)
Interface of the closure for frame rendering jobs.
Individual frame rendering task, forwarding to a closure.
Stub/Test implementation of the JobFunctor interface for a render job to do nothing at all
Building tree expanding and backtracking evaluations within hierarchical scopes.
int lumiera_invokey_eq(void *l, void *r)
opaque ID attached to each individual job invocation.
Mock data structures to support implementation testing of render job planning and frame dispatch.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
auto singleValIterator(VAL &&something)
Build a SingleValIter: convenience free function shortcut, to pick up just any value and wrap it as L...
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
auto seqTuple(SEQ &&iter)
Unpack an iterator to build a fixed-size std::tuple of references.
string join(COLL &&coll, string const &delim=", ")
enumerate a collection's contents, separated by delimiter.
Generic implementation of a JobFunctor to perform no calculations.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
Some small helpers and convenience shortcuts to simplify working with tuples and sequences (given by ...
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.