28 #include <boost/rational.hpp> 30 using boost::rational_cast;
42 typedef Builder<TimeGrid> GridBuilder;
46 const Time TEST_ORIGIN (12,34);
49 const uint MAX_FRAMES = 1000;
50 const uint DIRT_GRAIN = 50;
69 createGrid_fullProcedure();
70 createGrid_simplified();
75 createGrid_fullProcedure()
77 GridID myGrID (randStr(8));
80 CHECK ( spec.fps == 1);
85 spec.origin = TEST_ORIGIN;
89 CHECK (myGrid->ident.name == myGrID.getSym());
93 int randomFrame =
rani(MAX_FRAMES);
95 Time point (myGrid->timeOf (randomFrame));
96 CHECK (point == TEST_ORIGIN + randomFrame * TEST_FPS.
duration());
98 int fract = 2 +
rani(DIRT_GRAIN);
99 FSecs dirt = (1/TEST_FPS) / fract;
104 CHECK (point == TEST_ORIGIN + myGrid->gridLocal(dirty));
109 createGrid_simplified()
112 CHECK (simplePALGrid);
113 CHECK (!util::isnil (simplePALGrid->ident.name));
114 cout <<
"simple PAL Grid: " << simplePALGrid->ident << endl;
116 CHECK (
Time(0,2) == simplePALGrid->timeOf(50));
117 CHECK (
Time(0,2) == simplePALGrid->timeOf(
FSecs(2)));
Framerate specified as frames per second.
typed symbolic and hash ID for asset-like position accounting.
int rani(uint bound=_iBOUND())
Steam-Layer implementation namespace root.
string randStr(size_t len)
create garbage string of given length
Lumiera's internal time value datatype.
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
boost::rational< int64_t > FSecs
rational representation of fractional seconds
A collection of frequently used helper functions to support unit testing.
Duration duration() const
duration of one frame
To establish a reference scale for quantised time values.
a family of time value like entities and their relationships.
The asset subsystem of the Steam-Layer.
basic constant internal time value.
static const FrameRate PAL
predefined constant for PAL framerate