Lumiera  0.pre.03
»edit your freedom«
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 "include/play-facade.hpp"
32 #include "lib/time/control.hpp"
33 
34 
35 
36 namespace steam {
37 namespace play {
38 namespace test {
39 
40  namespace time = lib::time;
41 
43 //using steam::engine::test::testData;
44 //using steam::engine::test::TestFrame;
45 
46  using lumiera::Play;
47 
48  typedef time::Control<time::Duration> DurationControl;
49 
50  typedef DummyPlayConnection<PlayTestFrames_Strategy> DummyPlayer;
51 
52 
53  /***************************************************************/
60  class DummyPlayConnection_test : public Test
61  {
62  virtual void
63  run (Arg)
64  {
65  verify_simulatedPlayback();
66  }
67 
68 
69  void
70  verify_simulatedPlayback()
71  {
72  DummyPlayer dummy;
73  CHECK (!dummy.isWired());
74 
75  Play::Controller player
76  = Play::facade().perform ( dummy.getAllModelPorts()
77  , dummy.provide_testOutputSlot());
78  CHECK ( dummy.isWired());
79 
80  DurationControl playDuration;
81  player.controlDuration (playDuration);
82 
83  // configure the controller to playback only for a fixed time duration
84  playDuration (dummy.getPlannedTestDuration());
85 
86  CHECK (!player.is_playing());
87 
88  player.play(true); // hit the start button
89  CHECK (player.is_playing());
90 
91  dummy.waitUntilDue(); // test helper: block waiting until planned test should be done
92 
93  CHECK (!player.is_playing()); // should have returned to pause, since we've set a fixed playback duration
94  CHECK (dummy.isWired());
95 
96  player.close();
97  CHECK (!dummy.isWired());
98  CHECK (dummy.gotCorrectOutput());
99  }
100  };
101 
102 
104  LAUNCHER (DummyPlayConnection_test, "unit play");
105 
106 
107 
108 }}} // namespace steam::play::test
Frontend/Interface: controller-element to retrieve and change running time values.
Definition: control.hpp:134
Definition: run.hpp:49
Steam-Layer implementation namespace root.
Public access point to the playback service provided by the »play-out subsystem«
Interface to the Player subsystem of Lumiera (Steam-Layer).
Definition: play-facade.hpp:82
void waitUntilDue()
test helper: blocking wait during an output test.
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.
Simple test class runner.
Continuous playback process, which has been hooked up and started with a fixed set of output slots...
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:115
Manipulating and monitoring time entities with life changes.