25 #include <lal/LALStdlib.h>
27 #include <lal/AVFactories.h>
46 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
51 strftime(timestamp->data, timestamp->length,
"%F %T UTC %a", &utcDate);
53 sprintf(refstamp,
"1980-01-06 00:00:00 UTC Sun");
57 fprintf(stderr,
"refstamp = %s\n", refstamp);
58 fprintf(stderr,
"timestamp = %s\n", timestamp->data);
61 if (strcmp(refstamp, timestamp->data) != 0)
63 fprintf(stderr,
"XLALGPStoUTC conversion failed: wrong UTC result\n");
64 fprintf(stderr,
"TestGPStoUTC: date strings do not match, line %i, %s\n",
78 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
83 strftime(timestamp->data, timestamp->length,
"%F %T UTC %a", &utcDate);
85 sprintf(refstamp,
"1994-07-06 23:59:50 UTC Wed");
89 fprintf(stderr,
"refstamp = %s\n", refstamp);
90 fprintf(stderr,
"timestamp = %s\n", timestamp->data);
93 if (strcmp(refstamp, timestamp->data) != 0)
95 fprintf(stderr,
"GPStoUTC conversion failed: wrong UTC result\n");
108 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
113 strftime(timestamp->data, timestamp->length,
"%F %T UTC %a", &utcDate);
115 sprintf(refstamp,
"1998-12-31 23:59:60 UTC Thu");
119 fprintf(stderr,
"refstamp = %s\n", refstamp);
120 fprintf(stderr,
"timestamp = %s\n", timestamp->data);
123 if (strcmp(refstamp, timestamp->data) != 0)
125 fprintf(stderr,
"GPStoUTC conversion failed: wrong UTC result\n");
141 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
146 strftime(timestamp->data, timestamp->length,
"%F %T UTC %a", &utcDate);
150 sprintf(refstamp,
"2006-07-01 00:00:00 UTC Sat");
154 fprintf(stderr,
"refstamp = %s\n", refstamp);
155 fprintf(stderr,
"timestamp = %s\n", timestamp->data);
158 if (strcmp(refstamp, timestamp->data) != 0)
160 fprintf(stderr,
"GPStoUTC conversion failed: wrong UTC result\n");
177 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
184 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
198 fprintf(stderr,
"TestGPStoUTC: XLALGPSToUTC() failed, line %i, %s\n",
207 "TestUTCtoGPS: error in XLALUTCToGPS, line %i, %s\n",
225 "TestGPStoUTC: conversion from GPS to UTC and back to GPS failed, line %i, %s\n", __LINE__,
"$Id$");
void LALCheckMemoryLeaks(void)
CHARVector * XLALCreateCHARVector(UINT4 length)
void XLALDestroyCHARVector(CHARVector *vector)
INT4 XLALUTCToGPS(const struct tm *utc)
Returns the GPS seconds since the GPS epoch for a specified UTC time structure.
struct tm * XLALGPSToUTC(struct tm *utc, INT4 gpssec)
Returns a pointer to a tm structure representing the time specified in seconds since the GPS epoch.
int XLALGetBaseErrno(void)
Gets the XLAL base error number ignoring the internal-function-failed flag.
int XLALClearErrno(void)
Clears the XLAL error number, returns the old value.
@ XLAL_EDOM
Input domain error.
LIGOTimeGPS * XLALGPSSet(LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan)
Sets GPS time given GPS integer seconds and residual nanoseconds.
Vector of type CHAR, see DATATYPE-Vector types for more details.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
INT4 gpsNanoSeconds
Residual nanoseconds.