37 #include <boost/rational.hpp> 39 using boost::rational_cast;
51 typedef Builder<TimeGrid> GridBuilder;
55 const Time TEST_ORIGIN (12,34);
58 const uint MAX_FRAMES = 1000;
59 const uint DIRT_GRAIN = 50;
77 createGrid_fullProcedure();
78 createGrid_simplified();
83 createGrid_fullProcedure()
85 GridID myGrID (randStr(8));
88 CHECK ( spec.fps == 1);
93 spec.origin = TEST_ORIGIN;
97 CHECK (myGrid->ident.name == myGrID.getSym());
101 int randomFrame = (rand() % MAX_FRAMES);
103 Time point (myGrid->timeOf (randomFrame));
104 CHECK (point == TEST_ORIGIN + randomFrame * TEST_FPS.
duration());
106 int fract = 2 + rand() % DIRT_GRAIN;
107 FSecs dirt = (1/TEST_FPS) / fract;
112 CHECK (point == TEST_ORIGIN + myGrid->gridLocal(dirty));
117 createGrid_simplified()
120 CHECK (simplePALGrid);
121 CHECK (!util::isnil (simplePALGrid->ident.name));
122 cout <<
"simple PAL Grid: " << simplePALGrid->ident << endl;
124 CHECK (
Time(0,2) == simplePALGrid->timeOf(50));
125 CHECK (
Time(0,2) == simplePALGrid->timeOf(
FSecs(2)));
Framerate specified as frames per second.
typed symbolic and hash ID for asset-like position accounting.
Steam-Layer implementation namespace root.
string randStr(size_t len)
create garbage string of given length
Lumiera's internal time value datatype.
Simple 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