Lumiera  0.pre.03
»edit your freedom«
timing-constraints-test.cpp
Go to the documentation of this file.
1 /*
2  TimingConstraints(Test) - verify timing constraint specifications
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 
30 #include "steam/play/timings.hpp"
31 #include "lib/time/timevalue.hpp"
32 //#include "steam/engine/buffhandle.hpp"
33 //#include "steam/engine/testframe.hpp"
34 //#include "lib/time/control.hpp"
35 
36 
37 
38 namespace steam {
39 namespace play {
40 namespace test {
41 
42  using lib::time::Time;
43  using lib::time::Duration;
45 
46 //using steam::engine::BuffHandle;
47 //using steam::engine::test::testData;
48 //using steam::engine::test::TestFrame;
49 
50 //using lumiera::Play;
51 
52 //typedef time::Control<time::Duration> DurationControl;
53 //
54 //typedef DummyPlayConnection<PlayTestFrames_Strategy> DummyPlayer;
55 
56 
57  /***************************************************************/
61  class TimingConstraints_test : public Test
62  {
63  virtual void
64  run (Arg)
65  {
66  define_basicTimingConstraints();
67  }
68 
69 
70  void
71  define_basicTimingConstraints()
72  {
73  Timings timings (FrameRate::PAL);
74 
75  Time t(0,10);
76  Duration lengthPAL (1, FrameRate::PAL);
77 
78  CHECK (timings.getOrigin() == Time::ZERO);
79  CHECK (timings.getFrameDurationAt(t) == lengthPAL);
80  CHECK (ASAP == timings.playbackUrgency);
81 #if false
82 #endif
83  }
84  };
85 
86 
88  LAUNCHER (TimingConstraints_test, "unit play");
89 
90 
91 
92 }}} // namespace steam::play::test
Definition: run.hpp:49
Framerate specified as frames per second.
Definition: timevalue.hpp:664
Generic frame timing specification.
Definition: timings.hpp:95
Steam-Layer implementation namespace root.
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
Simple test class runner.
How to define a timing specification or constraint.
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:477
a family of time value like entities and their relationships.
static const FrameRate PAL
predefined constant for PAL framerate
Definition: timevalue.hpp:680