26 #include <boost/lexical_cast.hpp> 28 using boost::lexical_cast;
48 FSecs refval = isnil(arg)? 1 : lexical_cast<
long> (arg[1]);
53 checkComparisons (org);
54 checkComponentDiagnostics();
59 checkBasics (
Time const& ref)
70 CHECK (zero == (var - 2*(ref + two)) );
73 CHECK (zero == (var - ref));
78 checkComparisons (
Time const& ref)
84 CHECK (zero ==
Time());
89 CHECK ( (var == ref) );
90 CHECK (!(var != ref) );
91 CHECK ( (var >= ref) );
92 CHECK ( (var <= ref) );
93 CHECK (!(var < ref) );
94 CHECK (!(var > ref) );
96 var +=
Time(FSecs(2));
97 CHECK (!(var == ref) );
98 CHECK ( (var != ref) );
99 CHECK ( (var >= ref) );
100 CHECK (!(var <= ref) );
101 CHECK (!(var < ref) );
102 CHECK ( (var > ref) );
104 gavl_time_t gat(var);
105 CHECK (!(gat == ref) );
106 CHECK ( (gat != ref) );
107 CHECK ( (gat >= ref) );
108 CHECK (!(gat <= ref) );
109 CHECK (!(gat < ref) );
110 CHECK ( (gat > ref) );
112 CHECK ( (var == gat) );
113 CHECK (!(var != gat) );
114 CHECK ( (var >= gat) );
115 CHECK ( (var <= gat) );
116 CHECK (!(var < gat) );
117 CHECK (!(var > gat) );
122 checkComponentDiagnostics()
125 int millis =
rani(1000);
126 int secs =
rani (60);
127 int mins =
rani (60);
128 int hours =
rani (100);
131 CHECK (
Time() < time);
132 CHECK (millis == getMillis(time));
133 CHECK (secs == getSecs (time));
134 CHECK (mins == getMins (time));
135 CHECK (hours == getHours (time));
136 cout << time << endl;
140 CHECK ( 8 == getMillis(t2));
141 CHECK ( 2 == getSecs (t2));
142 CHECK ( 0 == getMins (t2));
143 CHECK ( 0 == getHours (t2));
147 CHECK ( 8 == getMillis(t3));
148 CHECK (30 == getSecs (t3));
149 CHECK ( 1 == getMins (t3));
150 CHECK ( 0 == getHours (t3));
152 Time t4(2008,118,58);
154 CHECK ( 8 == getMillis(t4));
155 CHECK ( 0 == getSecs (t4));
156 CHECK ( 0 == getMins (t4));
157 CHECK ( 1 == getHours (t4));
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
int rani(uint bound=_iBOUND())
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.
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
ExampleStrategy::Qualifier two(string additionalArg)
definition of another qualifier two(arg), accepting an additional argument
Generating (pseudo) random numbers with controlled seed.
a family of time value like entities and their relationships.