IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 18, 2006, 10:59:32 AM (21 years ago)
Author:
drobbin
Message:

Small update to TEO/polarTide. New fxn Time_TideUT1Corr done and tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astro/tst_psTime_04.c

    r5216 r6036  
    1111 *      Test F - Attempt to read data file with typo in number
    1212 *      Test G - Free data
     13 *      Test H - Attempt to use all timer functions
     14 *      Test I - Tidal Corrections to UT1-UTC
    1315 *
    1416 *  @author  Ross Harman, MHPCC
    1517 *  @author  Eric Van Alst, MHPCC
     18 *  @author  David Robbins, MHPCC
    1619 *
    17  *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2005-10-01 02:22:20 $
     20 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     21 *  @date  $Date: 2006-01-18 20:59:32 $
    1922 *
    2023 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3336static psS32 testTimeInit6(void);
    3437static psS32 testTimer1(void);
     38static psS32 testTideUT1Corr(void);
    3539
    3640testDescription tests[] = {
     
    4246                              {testTimeInit6,-6,"p_psTimeInit",0,false},
    4347                              {testTimer1,-7,"psTimer",0,false},
     48                              {testTideUT1Corr,-8,"psTime_TideUT1Corr",0,false},
    4449                              {NULL}
    4550                          };
     
    136141}
    137142
     143psS32 testTideUT1Corr(void)
     144{
     145    psTime *empty = NULL;
     146    psTime *tide = NULL;
     147    psTime *noTide = psTimeAlloc(PS_TIME_UTC);
     148    noTide->sec = 1049160600;
     149    noTide->nsec = 0;
     150    noTide->leapsecond = false;
     151
     152    empty = psTime_TideUT1Corr(tide);
     153    if (empty != NULL) {
     154        psError(PS_ERR_BAD_PARAMETER_NULL, false,
     155                "psTime_TideUT1Corr failed to return NULL for NULL input time.\n");
     156        return 1;
     157    }
     158
     159    empty = psTime_TideUT1Corr(noTide);
     160    if (empty->sec != 1049160599 || empty->nsec != 656982272) {
     161        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     162                "psTime_TideUT1Corr failed to return correct values.\n");
     163        printf("\nsec = %ld, nsec = %u\n", empty->sec, empty->nsec);
     164        return 2;
     165    }
     166
     167    if (!p_psTimeFinalize()) {
     168        return 3;
     169    }
     170
     171    psFree(empty);
     172    psFree(noTide);
     173
     174    return 0;
     175}
     176
Note: See TracChangeset for help on using the changeset viewer.