IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2007, 10:25:32 AM (19 years ago)
Author:
gusciora
Message:

Improved test coverage.

File:
1 edited

Legend:

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

    r12415 r13614  
    1818 *  @author  David Robbins, MHPCC
    1919 *
    20  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    21  *  @date  $Date: 2007-03-13 00:23:20 $
     20 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     21 *  @date  $Date: 2007-06-04 20:25:32 $
    2222 *
    2323 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3434    psLogSetFormat("HLNM");
    3535    psLogSetLevel(PS_LOG_INFO);
    36     plan_tests(16);
     36    plan_tests(19);
    3737
    3838
     
    114114    }
    115115
     116
    116117    // testTideUT1Corr()
     118    // Verify NULL return with NULL input
     119    // XXX: Verify error
    117120    {
    118121        psMemId id = psMemGetId();
    119         psTime *tide = NULL;
     122        psTime *empty = psTime_TideUT1Corr(NULL);
     123        ok(empty == NULL, "psTime_TideUT1Corr() returned NULL for NULL input time");
     124        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     125        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     126    }
     127
     128
     129    // testTideUT1Corr()
     130    //
     131    {
     132        psMemId id = psMemGetId();
    120133        psTime *noTide = psTimeAlloc(PS_TIME_UTC);
    121134        noTide->sec = 1049160600;
    122135        noTide->nsec = 0;
    123136        noTide->leapsecond = false;
    124         // Following should generate error message
    125         // XXX: We do not test error generation here
    126         psTime *empty = empty = psTime_TideUT1Corr(tide);
    127         ok(empty == NULL, "psTime_TideUT1Corr() returned NULL for NULL input time");
    128 
    129         empty = psTime_TideUT1Corr(noTide);
     137        psTime *empty = psTime_TideUT1Corr(noTide);
    130138        is_long(empty->sec, 1049160599, "psTime_TideUT1Corr() returned correct ->sec");
    131139        is_long(empty->nsec, 656981971, "psTime_TideUT1Corr() returned correct ->nsec");
    132 
    133140        ok(p_psTimeFinalize(), "p_psTimeFinalize() successful");
    134 
    135141        psFree(empty);
    136142        psFree(noTide);
    137143        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     144        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    138145    }
    139146}
Note: See TracChangeset for help on using the changeset viewer.