IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2005, 3:58:10 PM (22 years ago)
Author:
evanalst
Message:

Add additional test case for psTimeDelta function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psTime_03.c

    r2964 r2966  
    1919 *  @author  Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
    22  *  @date  $Date: 2005-01-13 01:35:30 $
     21 *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
     22 *  @date  $Date: 2005-01-13 01:58:10 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    130130    printFooter(stdout, "psTime", "Test F - Delta two times with underflow in microseconds", true);
    131131
     132    // Test F1 - Delta two times in UTC type
     133    printPositiveTestHeader(stdout,"psTime","Test F1 - Delta two UTC times");
     134    psTime *time20a = NULL;
     135    psTime *time20b = NULL;
     136    psF64 timeOut20 = 0.0;
     137    time20a = psTimeAlloc(PS_TIME_UTC);
     138    time20b = psTimeAlloc(PS_TIME_UTC);
     139    time20a->sec = 1090434113;
     140    time20a->usec = 272044;
     141    time20b->sec = 1090434112;
     142    time20b->usec = 272044;
     143    timeOut20 = psTimeDelta(time20a, time20b);
     144    if(fabs(timeOut20-1.000000000) > FLT_EPSILON) {
     145        printf("ERROR: Incorrect delta, %lf. Expected -1.00000\n",timeOut20);
     146    }
     147    printFooter(stdout,"psTime","Test F1 - Delta two UTC times",true);
    132148
    133149    // Test G - Add two times across leapsecond boundary
     
    185201    psFree(time8a);
    186202    psFree(time8b);
     203    psFree(time20a);
     204    psFree(time20b);
    187205    if (psMemCheckLeaks(0, NULL, stdout,false)) {
    188206        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
Note: See TracChangeset for help on using the changeset viewer.