25 #include <lal/LALStdlib.h>
30 static int do_test(
int gpssec,
int tai_utc_before,
int tai_utc_after)
36 printf(
"TestLeapSecs: BEFORE LEAP SECOND ADDED\n");
39 printf(
"\tGPS = %9d; TAI-UTC = %d\n", gpssec - 1, lal_tai_utc);
45 if(lal_tai_utc != tai_utc_before) {
47 fprintf(stderr,
"TestLeapSecs: XLALLeapSeconds() returned wrong value: expected %d, got %d\n", tai_utc_before, lal_tai_utc);
52 printf(
"TestLeapSecs: AFTER LEAP SECOND ADDED\n");
55 printf(
"\tGPS = %9d; TAI-UTC = %d\n\n", gpssec, lal_tai_utc);
61 if(lal_tai_utc != tai_utc_after) {
63 fprintf(stderr,
"TestLeapSecs: XLALLeapSeconds() returned wrong value: expected %d, got %d\n", tai_utc_after, lal_tai_utc);
static int do_test(int gpssec, int tai_utc_before, int tai_utc_after)
static const struct leaps_table leaps[]
static const int numleaps
int XLALLeapSeconds(INT4 gpssec)
Returns the leap seconds TAI-UTC at a given GPS second.
int XLALGetBaseErrno(void)
Gets the XLAL base error number ignoring the internal-function-failed flag.
#define XLAL_PERROR()
Prints an error message for the current value of xlalErrno.