29 #include <lal/LALStdlib.h>
31 #include <lal/AVFactories.h>
40 #define LONGESTSTR 256
43 #define LALTESTINCREMENTGPSC_ENORM 0
44 #define LALTESTINCREMENTGPSC_ESUB 1
46 #define LALTESTINCREMENTGPSC_MSGENORM "Normal exit"
47 #define LALTESTINCREMENTGPSC_MSGESUB "LAL Subroutine failed"
122 double deltaT1, deltaT0;
132 deltaT0 = -1461420.688922178;
133 if (fabs(deltaT1 - deltaT0) >= .5e-9) {
134 LALPrintError (
"Failure in XLALGPSDiff(): got %.17g instead of %.17g\n", deltaT1, deltaT0);
141 LALPrintError (
"Failure in 1.) XLALGPSAdd(): got %d.%09ds instead of %d.%09ds\n",
150 LALPrintError (
"Failure in 2.) XLALGPSAdd(): got %d.%09ds instead of %d.%09ds\n",
160 LALPrintError (
"Failure in 3.) XLALGPSAdd(): got %d.%09ds instead of %d.%09ds\n",
169 LALPrintError (
"Failure in 4.) XLALGPSAdd(): got %d.%09ds instead of %d.%09ds\n",
188 fprintf(stderr,
"%s; expected %d got %d\n\n", msg, expected_val, got_val);
198 if (
XLALGPSCmp(p_gps1, p_gps2) != expected_val)
212 static int sprint_time_interval(
char *str,
213 const LALTimeInterval *p_time_interval)
215 return snprintf(str,
LONGESTSTR - 1 - strlen(str),
216 "%9d:%09d", p_time_interval->seconds,
217 p_time_interval->nanoSeconds);
static BOOLEAN compare_gps_ok(const LIGOTimeGPS *p_gps1, const LIGOTimeGPS *p_gps2, int expected_val)
static int print_compare_errmsg_maybe(const char *msg, int expected_val, int got_val)
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
int32_t INT4
Four-byte signed integer.
int LALPrintError(const char *fmt,...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
Adds a double to a GPS time.
int XLALGPSCmp(const LIGOTimeGPS *t0, const LIGOTimeGPS *t1)
Compares two GPS times.
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
Difference between two GPS times as double.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
INT4 gpsNanoSeconds
Residual nanoseconds.