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)
5  2012, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
19 #include "lib/test/run.hpp"
20 
22 #include "include/play-facade.hpp"
23 #include "lib/time/control.hpp"
24 
25 
26 
27 namespace steam {
28 namespace play {
29 namespace test {
30 
31  namespace time = lib::time;
32 
34 //using steam::engine::test::testData;
35 //using steam::engine::test::TestFrame;
36 
37  using lumiera::Play;
38 
39  typedef time::Control<time::Duration> DurationControl;
40 
41  typedef DummyPlayConnection<PlayTestFrames_Strategy> DummyPlayer;
42 
43 
44  /***************************************************************/
51  class DummyPlayConnection_test : public Test
52  {
53  virtual void
54  run (Arg)
55  {
56  verify_simulatedPlayback();
57  }
58 
59 
60  void
61  verify_simulatedPlayback()
62  {
63  DummyPlayer dummy;
64  CHECK (!dummy.isWired());
65 
66  Play::Controller player
67  = Play::facade().perform ( dummy.getAllModelPorts()
68  , dummy.provide_testOutputSlot());
69  CHECK ( dummy.isWired());
70 
71  DurationControl playDuration;
72  player.controlDuration (playDuration);
73 
74  // configure the controller to playback only for a fixed time duration
75  playDuration (dummy.getPlannedTestDuration());
76 
77  CHECK (!player.is_playing());
78 
79  player.play(true); // hit the start button
80  CHECK (player.is_playing());
81 
82  dummy.waitUntilDue(); // test helper: block waiting until planned test should be done
83 
84  CHECK (!player.is_playing()); // should have returned to pause, since we've set a fixed playback duration
85  CHECK (dummy.isWired());
86 
87  player.close();
88  CHECK (!dummy.isWired());
89  CHECK (dummy.gotCorrectOutput());
90  }
91  };
92 
93 
95  LAUNCHER (DummyPlayConnection_test, "unit play");
96 
97 
98 
99 }}} // namespace steam::play::test
Frontend/Interface: controller-element to retrieve and change running time values.
Definition: control.hpp:125
Definition: run.hpp:40
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:73
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:81
Dummy and test setup of playback and rendering, omitting most of the Lumiera engine.
Simplistic test class runner.
Continuous playback process, which has been hooked up and started with a fixed set of output slots...
Definition: play-facade.hpp:98
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:111
Manipulating and monitoring time entities with life changes.