34 #include <boost/lexical_cast.hpp> 37 using boost::lexical_cast;
58 FSecs refval = isnil(arg)? 1 : lexical_cast<
long> (arg[1]);
63 checkComparisons (org);
64 checkComponentDiagnostics();
69 checkBasics (
Time const& ref)
80 CHECK (zero == (var - 2*(ref + two)) );
83 CHECK (zero == (var - ref));
88 checkComparisons (
Time const& ref)
94 CHECK (zero ==
Time());
99 CHECK ( (var == ref) );
100 CHECK (!(var != ref) );
101 CHECK ( (var >= ref) );
102 CHECK ( (var <= ref) );
103 CHECK (!(var < ref) );
104 CHECK (!(var > ref) );
106 var +=
Time(FSecs(2));
107 CHECK (!(var == ref) );
108 CHECK ( (var != ref) );
109 CHECK ( (var >= ref) );
110 CHECK (!(var <= ref) );
111 CHECK (!(var < ref) );
112 CHECK ( (var > ref) );
114 gavl_time_t gat(var);
115 CHECK (!(gat == ref) );
116 CHECK ( (gat != ref) );
117 CHECK ( (gat >= ref) );
118 CHECK (!(gat <= ref) );
119 CHECK (!(gat < ref) );
120 CHECK ( (gat > ref) );
122 CHECK ( (var == gat) );
123 CHECK (!(var != gat) );
124 CHECK ( (var >= gat) );
125 CHECK ( (var <= gat) );
126 CHECK (!(var < gat) );
127 CHECK (!(var > gat) );
132 checkComponentDiagnostics()
134 int millis = rand() % 1000;
135 int secs = rand() % 60;
136 int mins = rand() % 60;
137 int hours = rand() % 100;
140 CHECK (
Time() < time);
141 CHECK (millis == getMillis(time));
142 CHECK (secs == getSecs (time));
143 CHECK (mins == getMins (time));
144 CHECK (hours == getHours (time));
145 cout << time << endl;
149 CHECK ( 8 == getMillis(t2));
150 CHECK ( 2 == getSecs (t2));
151 CHECK ( 0 == getMins (t2));
152 CHECK ( 0 == getHours (t2));
156 CHECK ( 8 == getMillis(t3));
157 CHECK (30 == getSecs (t3));
158 CHECK ( 1 == getMins (t3));
159 CHECK ( 0 == getHours (t3));
161 Time t4(2008,118,58);
163 CHECK ( 8 == getMillis(t4));
164 CHECK ( 0 == getSecs (t4));
165 CHECK ( 0 == getMins (t4));
166 CHECK ( 1 == getHours (t4));
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Extension to the lib::time::Time wrapper, adding output and further diagnostic aids.
Implementation namespace for support and library code.
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
ExampleStrategy::Qualifier two(string additionalArg)
definition of another qualifier two(arg), accepting an additional argument
a family of time value like entities and their relationships.