Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
engine-interface-test.cpp
Go to the documentation of this file.
1 /*
2  EngineInterface(Test) - verify basics of the engine (scheduling) service
3 
4  Copyright (C) Lumiera.org
5  2011, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
28 #include "lib/test/run.hpp"
29 #include "lib/error.hpp"
30 
37 #include "proc/asset/pipe.hpp"
38 #include "lib/time/timevalue.hpp"
39 
40 //#include <ctime>
41 
42 using test::Test;
43 //using std::rand;
44 
45 
46 namespace proc {
47 namespace engine{
48 namespace test {
49 
50  using asset::Pipe;
51  using asset::PPipe;
52  using mobject::ModelPort;
56 
59 
60 
61  namespace { // test fixture...
62 
63  } // (End) test fixture
64 
65 
66 
67  /***************************************************************/
84  class EngineInterface_test : public Test
85  {
86 
87  virtual void
88  run (Arg)
89  {
90  UNIMPLEMENTED ("simple standard case of Engine interface usage");
91 
93  EngineDiagnostics monitor(engine);
94 
95  PID pipe = Pipe::query("id(dummy)");
96  ModelPort port(pipe);
97 
99  Allocation& output = oSlot.allocate();
100  Timings timings (FrameRate::PAL);
101 
102  // Invoke test subject...
103  CalcStreams calc = engine.calculate(port, timings, output);
104 
106 
107  CHECK (monitor.has_scheduled_jobs_for(timings));
108  }
109 
110  };
111 
112 
114  LAUNCHER (EngineInterface_test, "function engine");
115 
116 
117 
118 }}} // namespace proc::engine::test
Organising the output data calculation possibilities.
An (abstract) capability to send media data to an external output.
CalcStreams calculate(ModelPort mPort, Timings nominalTimings, OutputConnection &output, Quality serviceQuality=QoS_DEFAULT)
core operation: activate the Lumiera Render Engine.
Access point for the (core) calculation service of the render engine.
OutputSlot::Allocation Allocation
A "processing pipe" represented as Asset.
Definition: run.hpp:49
Framerate specified as frames per second.
Definition: timevalue.hpp:547
An facility for writing unit-tests against the OutputSlot interface.
LAUNCHER(BuffTable_test,"unit engine")
Register this test class...
lib::P< Pipe > PPipe
Definition: pipe.hpp:51
std::vector< CalcStream > CalcStreams
Abstract Base Class for all testcases.
Definition: run.hpp:62
std::vector< string > & Arg
Definition: run.hpp:54
Simple test class runner.
A service to schedule series of calculations, delivering the rendered data into an external output si...
An facility to check and monitor engine operations.
Helper for unit tests: Mock output sink.
Allocation & allocate()
claim this slot for exclusive use
Definition: output-slot.cpp:82
Interface: Generic output sink.
A core abstraction within the render engine to represent an ongoing calculation.
Lumiera error handling (C++ interface).
Render engine diagnostic facility.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
Definition: pipe.hpp:79
bool has_scheduled_jobs_for(Timings const &timings)
static OutputSlot & build()
build a new Diagnostic Output Slot instance, discard the existing one.
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
static lib::Depend< EngineService > instance
access point to the Engine Interface.
a family of time value like entities and their relationships.
static const FrameRate PAL
predefined constant for PAL framerate
Definition: timevalue.hpp:561