Index: trunk/psLib/test/astro/tap_psTime_01.c
===================================================================
--- trunk/psLib/test/astro/tap_psTime_01.c	(revision 13084)
+++ trunk/psLib/test/astro/tap_psTime_01.c	(revision 13614)
@@ -23,6 +23,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-27 22:52:02 $
+ *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-06-04 20:25:32 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -131,10 +131,20 @@
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(178);
+    plan_tests(198);
     // Initialize library internal structures
     psLibInit("pslib.config");
 
 
-    // Test psTimeAlloc()
+    // Allocate new psTime with unallowed time type
+    // Following should generate error message
+    {
+        psMemId id = psMemGetId();
+        psTime *time = psTimeAlloc(-100);
+        ok(time == NULL, "psTimeAlloc(-100) returned NULL");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Test psTimeAlloc(TAI)
     {
         psMemId id = psMemGetId();
@@ -151,14 +161,65 @@
     }
 
-    // Allocate new psTime with invalid time type
-    // Following should generate error message
-    {
-        psMemId id = psMemGetId();
-        psTime *time = psTimeAlloc(-100);
-        ok(time == NULL, "psTimeAlloc(-100) returned NULL");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
+
+    // Test psTimeAlloc(UTC)
+    {
+        psMemId id = psMemGetId();
+        psTime *time = psTimeAlloc(PS_TIME_UTC);
+        ok(time != NULL, "psTimeAlloc() did not return NULL");
+        skip_start(time == NULL, 4, "Skipping tests because psTimeAlloc() failed");
+        ok(time->type == PS_TIME_UTC, "psTimeAlloc() correctly set psTime->type");
+        ok(time->sec == 0, "psTimeAlloc() correctly set psTime->sec");
+        ok(time->nsec == 0, "psTimeAlloc() correctly set psTime->nsec");
+        ok(time->leapsecond == false, "psTimeAlloc() correctly set psTime->leapsecond");
+        psFree(time);
+        skip_end();
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Test psTimeAlloc(UT1)
+    {
+        psMemId id = psMemGetId();
+        psTime *time = psTimeAlloc(PS_TIME_UT1);
+        ok(time != NULL, "psTimeAlloc() did not return NULL");
+        skip_start(time == NULL, 4, "Skipping tests because psTimeAlloc() failed");
+        ok(time->type == PS_TIME_UT1, "psTimeAlloc() correctly set psTime->type");
+        ok(time->sec == 0, "psTimeAlloc() correctly set psTime->sec");
+        ok(time->nsec == 0, "psTimeAlloc() correctly set psTime->nsec");
+        ok(time->leapsecond == false, "psTimeAlloc() correctly set psTime->leapsecond");
+        psFree(time);
+        skip_end();
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Test psTimeAlloc(TT)
+    {
+        psMemId id = psMemGetId();
+        psTime *time = psTimeAlloc(PS_TIME_TT);
+        ok(time != NULL, "psTimeAlloc() did not return NULL");
+        skip_start(time == NULL, 4, "Skipping tests because psTimeAlloc() failed");
+        ok(time->type == PS_TIME_TT, "psTimeAlloc() correctly set psTime->type");
+        ok(time->sec == 0, "psTimeAlloc() correctly set psTime->sec");
+        ok(time->nsec == 0, "psTimeAlloc() correctly set psTime->nsec");
+        ok(time->leapsecond == false, "psTimeAlloc() correctly set psTime->leapsecond");
+        psFree(time);
+        skip_end();
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
 
     // Test psTimeGetNow()
+    // Attempt to get time with unallowed type
+    // Following should generate an error message for unallowed time type
+    {
+        psMemId id = psMemGetId();
+        psTime *timeNow = psTimeGetNow(-100);
+        ok(timeNow == NULL, "psTimeGetNow(-100) returned NULL");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Test psTimeGetNow(TAI)
     {
         psMemId id = psMemGetId();
@@ -167,4 +228,6 @@
         skip_start(time == NULL, 4, "Skipping tests because psTimeGetNow() failed");
         ok(timeNow->type == PS_TIME_TAI, "psTimeGetNow() correctly set psTime->type");
+        ok(timeNow->sec != 0, "psTimeAlloc() set psTime->sec to something");
+        ok(timeNow->nsec != 0, "psTimeAlloc() set psTime->nsec to something");
         psFree(timeNow);
         skip_end();
@@ -172,12 +235,4 @@
     }
 
-    // Attempt to get time with invalid type
-    // Following should generate an error message for invalid time type
-    {
-        psMemId id = psMemGetId();
-        psTime *timeNow = psTimeGetNow(-100);
-        ok(timeNow == NULL, "psTimeGetNow(-100) returned NULL");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
 
     // Test psTimeGetUT1Delta()
@@ -191,5 +246,5 @@
     }
 
-    // Attempt to convert invalid time
+    // Attempt to convert unallowed time
     // Following should generate an error message for incorrect time
     {
@@ -205,5 +260,5 @@
     }
 
-    // Attempt to convert time with invalid bulletin
+    // Attempt to convert time with unallowed bulletin
     // Following should generate an error message for incorrect bulletin
     {
@@ -360,10 +415,9 @@
         time->nsec = testTime1NanosecondsUTC;
         psF64 mjd = psTimeToMJD(time);
-
         is_double_tol(mjd, 53207.765929, ERROR_TOL, "psTimeToMJD() returned correct time after 1/1/1970 epoch");
-
-        psFree(time);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
+        psFree(time);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
 
     // psTimeToMJD()
@@ -375,7 +429,5 @@
         time->nsec = testTime4NanosecondsUTC;
         psF64 mjd = psTimeToMJD(time);
-
         is_double_tol(mjd, testTime4MJD, ERROR_TOL, "psTimeToMJD() returned correct time before 1/1/1970 epoch");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -390,8 +442,8 @@
         psMemId id = psMemGetId();
         psF64 jd = psTimeToJD(NULL);
-
         is_double(jd, NAN, "psTimeToJD(NULL) returned NULL");
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // psTimeToJD()
@@ -406,7 +458,5 @@
         time->leapsecond = false;
         psF64 jd = psTimeToJD(time);
-        
         is_double(jd, NAN, "psTimeToJD() returned NAN for incorrect time");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -422,7 +472,5 @@
         time->nsec = testTime1NanosecondsUTC;
         psF64 jd = psTimeToJD(time);
-
         is_double_tol(jd, 2453208.265929, ERROR_TOL, "psTimeToJD() returned the correct time after 1/1/1970 epoch");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -438,7 +486,5 @@
         time->nsec = testTime4NanosecondsUTC;
         psF64 jd = psTimeToJD(time);
-
         is_double_tol(jd, testTime4JD, ERROR_TOL, "psTimeToJD() returned the correct time before 1/1/1970 epoch");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -453,10 +499,9 @@
         psMemId id = psMemGetId();
         char *timeStr = psTimeToISO(NULL);
-
         ok(timeStr == NULL, "psTimeToISO(NULL) returned NULL");
-
         psFree(timeStr);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Test psTimeToISO()
@@ -471,7 +516,5 @@
         time->nsec = 2e9;
         char *timeStr = psTimeToISO(time);
-
         ok(timeStr == NULL, "psTimeToISO(time) returned NULL for incorrect time");
-
         psFree(time);
         psFree(timeStr);
@@ -490,7 +533,5 @@
         time->nsec = testTime5NanosecondsUTC;
         char *timeStr = psTimeToISO(time);
-
         ok(timeStr == NULL, "psTimeToISO(time) returned NULL for time prior to year 0000");
-
         psFree(time);
         psFree(timeStr);
@@ -527,7 +568,5 @@
         time->nsec = testTime1NanosecondsUTC;
         char *timeStr = psTimeToISO(time);
-
         is_str(timeStr, testTime1Str, "psTimeToISO(time) returned correct time (no leapsecond)");
-
         psFree(timeStr);
         psFree(time);
@@ -546,7 +585,5 @@
         time->leapsecond = true;
         char *timeStr = psTimeToISO(time);
-
         is_str(timeStr, testTime1StrLeap, "psTimeToISO(time) returned correct time (with leapsecond)");
-
         psFree(timeStr);
         psFree(time);
@@ -580,7 +617,5 @@
         time->nsec = 2e9;
         struct timeval *timevalTime = psTimeToTimeval(time);
-
         ok(timevalTime == NULL, "psTimeToTimeval() returned NULL for incorrect time");
-
         psFree(time);
         psFree(timevalTime);
@@ -599,7 +634,5 @@
         time->nsec = 0;
         struct timeval *timevalTime = psTimeToTimeval(time);
-
         ok(timevalTime == NULL, "psTimeToTimeval() returned NULL for incorrect time");
-
         psFree(time);
         psFree(timevalTime);
@@ -617,8 +650,6 @@
         time->nsec = testTime1NanosecondsUTC;
         struct timeval *timevalTime = psTimeToTimeval(time);
-
         is_long(timevalTime->tv_sec, testTime1TimevalSec, "psTimeToTimeval()->tv_sec");
         is_long(timevalTime->tv_usec, testTime1TimevalUsec, "psTimeToTimeval()->tv_usec");
-
         psFree(time);
         psFree(timevalTime);
@@ -632,8 +663,6 @@
         psMemId id = psMemGetId();
         psTime *time = psTimeFromMJD(testTime1MJDTAI);
-
         ok(time->type == PS_TIME_TAI, "psTimeFromMJD() returned the correct type");
         is_long(time->sec, testTime1SecondsTAI, "psTimeFromMJD()->sec");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -646,8 +675,6 @@
         psMemId id = psMemGetId();
         psTime *time = psTimeFromMJD(testTime4MJD);
-
         ok(time->type == PS_TIME_TAI, "psTimeFromMJD() returned the correct type");
         is_long(time->sec, testTime4SecondsUTC, "psTimeFromMJD()->sec");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -660,8 +687,6 @@
         psMemId id = psMemGetId();
         psTime *time = psTimeFromJD(testTime1JDTAI);
-
         ok(time->type == PS_TIME_TAI, "psTimeFromJD() returned the correct type");
         is_long(time->sec, testTime1SecondsTAI, "psTimeFromJD()->sec");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -843,6 +868,6 @@
 
     // psTimeConvert()
-    // Attempt to convert to incorrect type
-    // Following should generate an error message for incorrect type
+    // Following should generate an error message for incorrect type output
+    // Input psTime struct is PS_TIME_TAI
     // XXX: We don't test whether the error message is generated
     {
@@ -850,8 +875,22 @@
         psTime *time1 = psTimeAlloc(PS_TIME_TAI);
         psTime *time2 = psTimeConvert(time1,-100);
-
         ok(time2 == NULL, "psTimeConvert(time1, -100) returned NULL");
-
-        psFree(time1);
+        psFree(time1);
+        psFree(time2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // psTimeConvert()
+    // Following should generate an error message for incorrect type output
+    // Input psTime struct is PS_TIME_UTC
+    // XXX: We don't test whether the error message is generated
+    {
+        psMemId id = psMemGetId();
+        psTime *time1 = psTimeAlloc(PS_TIME_UTC);
+        psTime *time2 = psTimeConvert(time1,-100);
+        ok(time2 == NULL, "psTimeConvert(time1, -100) returned NULL");
+        psFree(time1);
+        psFree(time2);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -860,36 +899,19 @@
     // psTimeConvert()
     // Following should generate an error message for incorrect type
-    // XXX: We don't test whether the error message is generated
-    {
-        psMemId id = psMemGetId();
-        psTime *time1 = psTimeAlloc(PS_TIME_TAI);
-        time1->type = PS_TIME_UTC;
+    // Input psTime struct is PS_TIME_TT
+    // XXX: We don't test whether the error message is generated
+    {
+        psMemId id = psMemGetId();
+        psTime *time1 = psTimeAlloc(PS_TIME_TT);
         psTime *time2 = psTimeConvert(time1,-100);
-
         ok(time2 == NULL, "psTimeConvert(time1, -100) returned NULL");
-
-        psFree(time1);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // psTimeConvert()
-    // Following should generate an error message for incorrect type
-    // XXX: We don't test whether the error message is generated
-    {
-        psMemId id = psMemGetId();
-        psTime *time1 = psTimeAlloc(PS_TIME_TAI);
-        time1->type = PS_TIME_TT;
-        psTime *time2 = psTimeConvert(time1,-100);
-
-        ok(time2 == NULL, "psTimeConvert(time1, -100) returned NULL");
-
-        psFree(time1);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // psTimeConvert()
-    // Following should generate an error message for incorrect type
+        psFree(time1);
+        psFree(time2);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // psTimeConvert()
+    // Following should generate an error message for incorrect type input
     // XXX: We don't test whether the error message is generated
     {
@@ -898,8 +920,7 @@
         time1->type = -100;
         psTime *time2 = psTimeConvert(time1,PS_TIME_TAI);
-
         ok(time2 == NULL, "psTimeConvert(time1, PS_TIME_TAI) returned NULL");
-
-        psFree(time1);
+        psFree(time1);
+        psFree(time2);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -915,8 +936,7 @@
         time1->nsec = 2e9;
         psTime *time2 = psTimeConvert(time1, PS_TIME_TAI);
-
         ok(time2 == NULL, "psTimeConvert(time1, PS_TIME_TAI) returns NULL for incorrect psTime object");
-
-        psFree(time1);
+        psFree(time1);
+        psFree(time2);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -932,5 +952,4 @@
         time1->type = PS_TIME_TAI;
         time1->leapsecond = false;
-
         psTime *time2 = psTimeConvert(time1, PS_TIME_TAI);
         ok(time2 == time1, "psTimeConvert(time, ...) returns time for conversion to same type");
Index: trunk/psLib/test/astro/tap_psTime_02.c
===================================================================
--- trunk/psLib/test/astro/tap_psTime_02.c	(revision 13084)
+++ trunk/psLib/test/astro/tap_psTime_02.c	(revision 13614)
@@ -12,6 +12,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-27 22:52:02 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-06-04 20:25:32 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -64,8 +64,6 @@
     {
         psMemId id = psMemGetId();
-
         psF64 lmst = psTimeToLMST(NULL, 0);
-        is_double(lmst, NAN, "psTimeToLMST(time,0) returned NAN");
-
+        is_double(lmst, NAN, "psTimeToLMST(NULL, 0) returned NAN");
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -80,8 +78,6 @@
         time->nsec = testTime1NanosecondsUTC;
         time->leapsecond = false;
-
         psF64 lmst = psTimeToLMST(time, 0.0);
         is_double_tol(lmst, testTime1LMST0, ERROR_TOL, "psTimeToLMST() returned the correct time");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -90,5 +86,5 @@
 
     // psTimeToLMST()
-    // Attempt to get LMST with invalid input time UT1
+    // Attempt to get LMST with unallowed input time UT1
     // Following should generate error message for incorrect type
     // XXX: We do not test the error generation
@@ -100,8 +96,6 @@
         time->leapsecond = false;
         time->type = PS_TIME_UT1;
-
         psF64 lmst = psTimeToLMST(time,0.0);
         is_double(lmst, NAN, "psTimeToLMST() generated a NAN for incorrect type");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -115,12 +109,11 @@
     {
         psMemId id = psMemGetId();
-
         psS64 delta = psTimeLeapSecondDelta(NULL, NULL);
         is_long(delta, 0, "psTimeLeapSecondDelta(NULL, NULL) returned 0");
-
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // psTimeLeapSecondDelta()
     // Set test time 1
     // Attempt to get delta with NULL time2 argument
@@ -133,16 +126,15 @@
         time1->nsec = testTime1NanosecondsUTC;
         time1->leapsecond = false;
-
         psS64 delta = psTimeLeapSecondDelta(time1, NULL);
         is_long(delta, 0, "psTimeLeapSecondDelta(time1, NULL) returned 0");
-
-        psFree(time1);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // Set test time 2 with invalid time
-    // Attempt to get delta with invalid time2
-    // Following should generate an error message for invalid time
+        psFree(time1);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // psTimeLeapSecondDelta()
+    // Set test time 2 with unallowed time
+    // Attempt to get delta with unallowed time2
+    // Following should generate an error message for unallowed time
     // XXX: We do not test the error generation
     {
@@ -156,8 +148,6 @@
         time2->nsec = 2e9;
         time2->leapsecond = false;
-
         psS64 delta = psTimeLeapSecondDelta(time1, time2);
         is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time2");
-
         psFree(time1);
         psFree(time2);
@@ -166,7 +156,8 @@
 
 
+    // psTimeLeapSecondDelta()
     // Set test time 2 valid
-    // Attempt to get delta with invalid time1
-    // Following should generate an error message for invalid time
+    // Attempt to get delta with unallowed time1
+    // Following should generate an error message for unallowed time
     // XXX: We do not test the error generation
     {
@@ -181,8 +172,6 @@
         time1->sec = 0;
         time1->nsec = 2e9;
-
         psS64 delta = psTimeLeapSecondDelta(time1,time2);
         is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time1");
-
         psFree(time1);
         psFree(time2);
@@ -191,4 +180,5 @@
 
 
+    // psTimeLeapSecondDelta()
     // Set test time 1 to greater time
     {
@@ -202,8 +192,6 @@
         time2->sec = testTime2SecondsUTC;
         time2->nsec = testTime2NanosecondsUTC;
-
         psS64 delta = psTimeLeapSecondDelta(time1,time2);
         is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
-
         psFree(time1);
         psFree(time2);
@@ -212,4 +200,5 @@
 
 
+    // psTimeLeapSecondDelta()
     // Set test time 1 to lesser time
     {
@@ -222,8 +211,6 @@
         time2->sec = testTime2SecondsUTC;
         time2->nsec = testTime2NanosecondsUTC;
-
         psS64 delta = psTimeLeapSecondDelta(time2, time1);
         is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
-
         psFree(time1);
         psFree(time2);
@@ -232,4 +219,5 @@
 
 
+    // psTimeLeapSecondDelta()
     // Attempt to get delta with times equal
     {
@@ -239,8 +227,6 @@
         time1->nsec = testTime1NanosecondsUTC;
         time1->leapsecond = false;
-
         psS64 delta = psTimeLeapSecondDelta(time1,time1);
         is_long(delta, 0, "psTimeLeapSecondDelta() produced the correct result");
-
         psFree(time1);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -254,16 +240,13 @@
     {
         psMemId id = psMemGetId();
-
         bool leapsecond = psTimeIsLeapSecond(NULL);
         is_bool(leapsecond, false, "psTimeIsLeapSecond(NULL) returned correct value");
-
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-
-    // psTimeIsLeapSecond()
-    // Set time
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // psTimeIsLeapSecond()
     // Attempt to determine if leap second with non-UTC time
-    // Following should generate an error message for invalid type
+    // Following should generate an error message for unallowed type
     // XXX: We do not test the error generation
     {
@@ -273,8 +256,6 @@
         time->nsec = testTime1NanosecondsUTC;
         time->leapsecond = false;
-
         bool leapsecond = psTimeIsLeapSecond(time);
         is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false with incorrect type");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -292,8 +273,6 @@
         time->leapsecond = false;
         time->type = PS_TIME_UTC;
-
         bool leapsecond = psTimeIsLeapSecond(time);
         is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -309,8 +288,6 @@
         time->sec = testTime3SecondsUTC;
         time->nsec = testTime3NanosecondsUTC;
-
         bool leapsecond = psTimeIsLeapSecond(time);
         is_bool(leapsecond, true, "psTimeIsLeapSecond() returned true");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -327,8 +304,6 @@
         time->nsec = testTime3NanosecondsUTC;
         time->sec--;
-
         bool leapsecond = psTimeIsLeapSecond(time);
         is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -343,9 +318,7 @@
         time->sec = testTime3SecondsUTC;
         time->nsec = testTime3NanosecondsUTC;
-        time->sec ++;
-
+        time->sec++;
         bool leapsecond = psTimeIsLeapSecond(time);
         is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
-
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -354,6 +327,6 @@
 
     // psTimeFromTT()
-    // Attempt to create psTime with invalid time
-    // Following should generate an error message for invalid time
+    // Attempt to create psTime with unallowed time
+    // Following should generate an error message for unallowed time
     // XXX: We do not test the error generation
     {
@@ -389,6 +362,6 @@
 
     // psTimeFromUTC()
-    // Attempt to create psTime with invalid time
-    // Following should generate an error message for invalid time
+    // Attempt to create psTime with unallowed time
+    // Following should generate an error message for unallowed time
     // XXX: We do not test the error generation
     {
Index: trunk/psLib/test/astro/tap_psTime_04.c
===================================================================
--- trunk/psLib/test/astro/tap_psTime_04.c	(revision 13084)
+++ trunk/psLib/test/astro/tap_psTime_04.c	(revision 13614)
@@ -18,6 +18,6 @@
  *  @author  David Robbins, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-13 00:23:20 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-06-04 20:25:32 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -34,5 +34,5 @@
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(16);
+    plan_tests(19);
 
 
@@ -114,26 +114,33 @@
     }
 
+
     // testTideUT1Corr()
+    // Verify NULL return with NULL input
+    // XXX: Verify error
     {
         psMemId id = psMemGetId();
-        psTime *tide = NULL;
+        psTime *empty = psTime_TideUT1Corr(NULL);
+        ok(empty == NULL, "psTime_TideUT1Corr() returned NULL for NULL input time");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // testTideUT1Corr()
+    // 
+    {
+        psMemId id = psMemGetId();
         psTime *noTide = psTimeAlloc(PS_TIME_UTC);
         noTide->sec = 1049160600;
         noTide->nsec = 0;
         noTide->leapsecond = false;
-        // Following should generate error message
-        // XXX: We do not test error generation here
-        psTime *empty = empty = psTime_TideUT1Corr(tide);
-        ok(empty == NULL, "psTime_TideUT1Corr() returned NULL for NULL input time");
-
-        empty = psTime_TideUT1Corr(noTide);
+        psTime *empty = psTime_TideUT1Corr(noTide);
         is_long(empty->sec, 1049160599, "psTime_TideUT1Corr() returned correct ->sec");
         is_long(empty->nsec, 656981971, "psTime_TideUT1Corr() returned correct ->nsec");
-
         ok(p_psTimeFinalize(), "p_psTimeFinalize() successful");
-
         psFree(empty);
         psFree(noTide);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
 }
