Lumiera  0.pre.03
»edityourfreedom«
dummy-play-connection-test.cpp
Go to the documentation of this file.
1 /*
2  DummyPlayConnection(Test) - create and verify a simplified test render engine setup
3 
4  Copyright (C) Lumiera.org
5  2012, 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 
31 //#include "proc/engine/buffhandle.hpp"
32 //#include "proc/engine/testframe.hpp"
33 #include "include/play-facade.hpp"
34 #include "lib/time/control.hpp"
35 
36 
37 
38 namespace proc {
39 namespace play {
40 namespace test {
41 
42  namespace time = lib::time;
43 
45 //using proc::engine::test::testData;
46 //using proc::engine::test::TestFrame;
47 
48  using lumiera::Play;
49 
51 
53 
54 
55  /***************************************************************/
62  class DummyPlayConnection_test : public Test
63  {
64  virtual void
65  run (Arg)
66  {
68  }
69 
70 
71  void
73  {
74  DummyPlayer dummy;
75  CHECK (!dummy.isWired());
76 
77  Play::Controller player
78  = Play::facade().perform ( dummy.provide_testModelPorts()
79  , dummy.provide_testOutputSlot());
80  CHECK ( dummy.isWired());
81 
82  DurationControl playDuration;
83  player.controlDuration (playDuration);
84 
85  // configure the controller to playback only for a fixed time duration
86  playDuration (dummy.getPlannedTestDuration());
87 
88  CHECK (!player.is_playing());
89 
90  player.play(true); // hit the start button
91  CHECK (player.is_playing());
92 
93  dummy.waitUntilDue(); // test helper: block waiting until planned test should be done
94 
95  CHECK (!player.is_playing()); // should have returned to pause, since we've set a fixed playback duration
96  CHECK (dummy.isWired());
97 
98  player.close();
99  CHECK (!dummy.isWired());
100  CHECK (dummy.gotCorrectOutput());
101  }
102  };
103 
104 
106  LAUNCHER (DummyPlayConnection_test, "unit player");
107 
108 
109 
110 }}} // namespace proc::play::test
void waitUntilDue()
test helper: blocking wait during an output test.
Frontend/Interface: controller-element to retrieve and change running time values.
Definition: control.hpp:131
Definition: run.hpp:49
Public access point to the playback service provided by the »play-out subsystem«
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:111
Interface to the Player subsystem of Lumiera (Proc-Layer).
Definition: play-facade.hpp:82
static lib::Depend< Play > facade
get an implementation instance of this service
Definition: play-facade.hpp:90
Dummy and test setup of playback and rendering, omitting most of the Lumiera engine.
std::vector< string > & Arg
Definition: run.hpp:54
Simple test class runner.
LAUNCHER(DummyPlayConnection_test, "unit player")
Register this test class...
Continuous playback process, which has been hooked up and started with a fixed set of output slots...
DummyPlayConnection< PlayTestFrames_Strategy > DummyPlayer
Manipulating and monitoring time entities with life changes.
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
Framework for dummy playback and rendering.
time::Control< time::Duration > DurationControl