26 #include <lal/LALStdio.h>
27 #include <lal/XLALError.h>
28 #include <lal/LALMalloc.h>
29 #include <lal/LALConstants.h>
30 #include <lal/TranslateMJD.h>
58 char mjdTTString[256];
69 "XLALTranslateMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
72 sprintf ( mjdTTString,
"%d.%014" LAL_INT8_FORMAT, mjdTTDays, (
INT8)round(mjdTTFracDays*1e14) );
75 "XLALTranslateStringMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
86 "XLALTranslateMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
89 sprintf ( mjdTTString,
"%d.%014" LAL_INT8_FORMAT, mjdTTDays, (
INT8)round(mjdTTFracDays*1e14) );
92 "XLALTranslateStringMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
98 mjdTTFracDays = 0.000696574074074074;
104 "XLALTranslateMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
107 sprintf ( mjdTTString,
"%d.%014" LAL_INT8_FORMAT, mjdTTDays, (
INT8)round(mjdTTFracDays*1e14) );
110 "XLALTranslateStringMJDTTtoGPS(%s) = (%d,%d) failed, correct result = (%d,%d)\n",
void LALCheckMemoryLeaks(void)
int test_MJDTT_GPS(void)
test conversion between MJD(TT) string and GPS value
double REAL8
Double precision real floating-point number (8 bytes).
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
int32_t INT4
Four-byte signed integer.
LIGOTimeGPS * XLALTranslateMJDTTtoGPS(LIGOTimeGPS *gps, INT4 mjdDays, REAL8 mjdFracDays)
convert given MJD(TT) time, mjd = mjdDays + mjdFracDays into LIGOTimeGPS format, preserving full (ns)...
LIGOTimeGPS * XLALTranslateStringMJDTTtoGPS(LIGOTimeGPS *gps, const char *mjdString)
Parse and convert given string representing MJD(TT) time into LIGOTimeGPS gps time,...
#define XLAL_CHECK(assertion,...)
Macro to test an assertion and invoke a failure if it is not true in a function that returns an integ...
#define XLAL_CHECK_MAIN(assertion,...)
Macro to test an assertion and invoke a failure if it is not true in a C main() routine.
@ XLAL_SUCCESS
Success return value (not an error number)
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_ETOL
Failed to reach specified tolerance.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
INT4 gpsNanoSeconds
Residual nanoseconds.