Go to the documentation of this file.
63 TestUtil testFramework(
"JulianDate",
"Constructor", __FILE__, __LINE__ );
71 testFramework.
assert(fabs((
long double)1350000 - Compare.
jd) < eps,
"Explicit constructor did not set the jd value properly", __LINE__);
80 testFramework.
assert(fabs((
long double)1350000 - Copy.
jd) < eps,
"Copy constructor did not set the jd value properly", __LINE__);
90 testFramework.
assert(fabs((
long double)1350000 - Assigned.
jd) < eps,
"Set Operator did not set the jd value properly", __LINE__);
105 TestUtil testFramework(
"JulianDate",
"setFromInfo", __FILE__, __LINE__ );
118 testFramework.
assert(setFromInfo1.
setFromInfo(Id),
"setFromInfo experienced an error and returned false", __LINE__);
119 testFramework.
assert(Compare == setFromInfo1,
"setFromInfo did not set all of the values properly", __LINE__);
126 testFramework.
assert(setFromInfo2.
setFromInfo(Id),
"setFromInfo experienced an error and returned false", __LINE__);
127 testFramework.
assert(Compare2 == setFromInfo2,
"setFromInfo did not set all of the values properly", __LINE__);
139 TestUtil testFramework(
"JulianDate",
"OperatorEquivalent", __FILE__, __LINE__ );
149 testFramework.
assert( Compare == CompareCopy,
"Equivalence operator found equivalent objects to be not equivalent", __LINE__);
150 testFramework.
assert(!(Compare == LessThanJD),
"Equivalence operator found different jd objects to be equivalent", __LINE__);
157 testFramework.
assert( Compare != LessThanJD,
"Not-equal operator found different jd objects to be equivalent", __LINE__);
158 testFramework.
assert(!(Compare != Compare),
"Not-equal operator found equivalent objects to not be equivalent", __LINE__);
165 testFramework.
assert( LessThanJD < Compare,
"Less-than operator found less-than jd object to not be less than", __LINE__);
166 testFramework.
assert(!(Compare < LessThanJD),
"Less-than operator found greater-than jd object to be less than", __LINE__);
167 testFramework.
assert(!(Compare < CompareCopy),
"Less-than operator found equivalent object to be less than", __LINE__);
174 testFramework.
assert(!(LessThanJD > Compare),
"Greater-than operator found less-than jd object to be greater than", __LINE__);
175 testFramework.
assert( Compare > LessThanJD,
"Greater-than operator found greater-than jd object to not be greater than", __LINE__);
176 testFramework.
assert(!(Compare > CompareCopy),
"Greater-than operator found equivalent object to be greater than", __LINE__);
183 testFramework.
assert( LessThanJD <= Compare,
"Less-than-or-equal-to operator found less-than jd object to not be less than or equal to", __LINE__);
184 testFramework.
assert(!(Compare <= LessThanJD),
"Less-than-or-equal-to operator found greater-than jd object to be less than or equal to", __LINE__);
185 testFramework.
assert( Compare <= CompareCopy,
"Less-than-or-equal-to operator found equivalent object to not be less than or equal to", __LINE__);
192 testFramework.
assert(!(LessThanJD >= Compare),
"Greater-than-or-equal-to operator found less-than jd object to be greater than or equal to", __LINE__);
193 testFramework.
assert( Compare >= LessThanJD,
"Greater-than-or-equal-to operator found greater-than jd object to not be greater than or equal to", __LINE__);
194 testFramework.
assert( Compare >= CompareCopy,
"Greater-than-or-equal-to operator found equivalent object to not be greater than or equal to", __LINE__);
205 TestUtil testFramework(
"JulianDate",
"reset", __FILE__, __LINE__ );
215 testFramework.
assert(Compare.
jd==0,
"reset() did not set the jd value to 0", __LINE__);
227 TestUtil testFramework(
"JulianDate",
"isValid", __FILE__, __LINE__ );
241 testFramework.
assert(Compare.
isValid(),
"Time provided found to be unable to convert to/from CommonTime", __LINE__);
253 testFramework.
assert(Compare.
getTimeSystem()== Test2.
getTimeSystem(),
"TimeSystem provided found to be different after converting to and from CommonTime", __LINE__);
254 testFramework.
assert(fabs(Test2.
jd - Compare.
jd) < eps,
"JD provided found to be different after converting to and from CommonTime", __LINE__);
265 TestUtil testFramework(
"JulianDate",
"OperatorEquivalentWithDifferingTimeSystem", __FILE__, __LINE__ );
279 testFramework.
assert(!(GPS1 == UTC1),
"Equivalence operator found objects with differing TimeSystems to be the same", __LINE__);
280 testFramework.
assert(GPS1 == ANY,
"Differing TimeSystems where one is TimeSystem::Any is not ignored for equals", __LINE__);
281 testFramework.
assert(UTC1 == ANY,
"Differing TimeSystems where one is TimeSystem::Any is not ignored for equals", __LINE__);
282 testFramework.
assert(UNKNOWN == ANY,
"Differing TimeSystems where one is TimeSystem::Any is not ignored for equals", __LINE__);
288 testFramework.
assert(GPS1 != UTC1,
"Equivalent objects with differing TimeSystems are found to be equal", __LINE__);
289 testFramework.
assert(GPS1 != UNKNOWN,
"Equivalent objects with differing TimeSystems are found to be equal", __LINE__);
290 testFramework.
assert(!(GPS1 != ANY),
"Equivalent objects with differing TimeSystems where one is TimeSystem::Any are found to be not-equal", __LINE__);
296 testFramework.
assert(ANY2 < GPS1,
"Less than object with Any TimeSystem is not found to be less than", __LINE__);
297 testFramework.
assert(GPS2 < ANY,
"Less than object with GPS TimeSystem is not found to be less-than a greater object with Any TimeSystem", __LINE__);
315 TestUtil testFramework(
"JulianDate",
"printf", __FILE__, __LINE__ );
324 testFramework.
assert(GPS1.
printf(
"%08J %02P") == (std::string)
"1350000.000000 GPS",
"printf did not output in the proper format", __LINE__);
325 testFramework.
assert(UTC1.
printf(
"%08J %02P") == (std::string)
"1350000.000000 UTC",
"printf did not output in the proper format", __LINE__);
332 testFramework.
assert(GPS1.
printError(
"%08J %02P") == (std::string)
"ErrorBadTime ErrorBadTime",
"printError did not output in the proper format", __LINE__);
333 testFramework.
assert(UTC1.
printError(
"%08J %02P") == (std::string)
"ErrorBadTime ErrorBadTime",
"printError did not output in the proper format", __LINE__);
345 int check, errorCounter = 0;
349 errorCounter += check;
352 errorCounter += check;
355 errorCounter += check;
358 errorCounter += check;
361 errorCounter += check;
364 errorCounter += check;
367 errorCounter += check;
369 std::cout <<
"Total Failures for " << __FILE__ <<
": " << errorCounter << std::endl;
virtual void reset()
Reset this object to the default state.
virtual void convertFromCommonTime(const CommonTime &ct)
virtual CommonTime convertToCommonTime() const
void assert(bool testExpression, const std::string &testMsg, const int lineNumber)
virtual bool setFromInfo(const IdToValue &info)
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
virtual std::string printError(const std::string &fmt) const
int setFromInfoTest(void)
void changeSourceMethod(const std::string &newMethod)
TimeSystem
Definition of various time systems.
@ UTC
Coordinated Universal Time (e.g., from NTP)
int initializationTest(void)
virtual bool isValid() const
Returns true if this object's members are valid, false otherwise.
int toFromCommonTimeTest(void)
virtual std::string printf(const std::string &fmt) const
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39