Index: trunk/psLib/test/astro/tap_psTime_03.c
===================================================================
--- trunk/psLib/test/astro/tap_psTime_03.c	(revision 12413)
+++ trunk/psLib/test/astro/tap_psTime_03.c	(revision 12414)
@@ -11,6 +11,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-12 21:11:21 $
+ *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-03-13 00:19:21 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -172,9 +172,9 @@
 //const char testTimeB2StrUT1[] = "1998-12-31T23:59:58,2Z";
 
-psS32 main(psS32 argc, char* argv[])
+int main(int argc, char* argv[])
 {
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(72);
+    plan_tests(77);
     psLibInit("pslib.config");
 
@@ -185,5 +185,7 @@
     {
         psMemId id = psMemGetId();
+
         ok(psTimeMath(NULL, -1.1) == NULL, "psTimeMath(NULL, -1.1) returned NULL");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -199,5 +201,7 @@
         time->sec = 0;
         time->nsec = 2e9;
+
         ok(psTimeMath(time, -1.1) == NULL, "psTimeMath() returns NULL for unallowable time input");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -211,11 +215,13 @@
         time->sec = testTime1SecondsUTC;
         time->nsec = testTime1NanosecondsUTC;
+
         psTime *newTime = psTimeMath(time, deltaTime1);
         ok(newTime != NULL, "psTimeMath() returns non-NULL for allowable time input (PS_TIME_UTC)");
         skip_start(newTime == NULL, 2, "Skipping tests because psTimeMath() returned NULL");
         ok(newTime->type == PS_TIME_UTC, "psTimeMath() returns the correct type (PS_TIME_UTC)");
-        ok((newTime->sec == newTestTime1SecondsUTC) && (newTime->nsec == newTestTime1NanosecondsUTC),
-           "psTimeMath() returns the correct ->sec and ->nsec (PS_TIME_UTC)");
+        is_long(newTime->sec, newTestTime1SecondsUTC, "psTimeMath() returns the correct ->sec");
+        is_long(newTime->nsec, newTestTime1NanosecondsUTC, "psTimeMath() returns the correct ->nsec");
         skip_end();
+
         psFree(newTime);
         psFree(time);
@@ -228,15 +234,16 @@
     {
         psMemId id = psMemGetId();
-        psTime *time = psTimeAlloc(PS_TIME_UTC);
+        psTime *time = psTimeAlloc(PS_TIME_TAI);
         time->sec = testTime1SecondsTAI;
         time->nsec = testTime1NanosecondsTAI;
-        time->type = PS_TIME_TAI;
+
         psTime *newTime = psTimeMath(time, deltaTime1);
         ok(newTime != NULL, "psTimeMath() returns non-NULL for allowable time input (PS_TIME_TAI)");
         skip_start(newTime == NULL, 2, "Skipping tests because psTimeMath() returned NULL");
         ok(newTime->type == PS_TIME_TAI, "psTimeMath() returns the correct type (PS_TIME_TAI)");
-        ok((newTime->sec == newTestTime1SecondsTAI) && (newTime->nsec == newTestTime1NanosecondsTAI),
-           "psTimeMath() returns the correct ->sec and ->nsec (PS_TIME_TAI)");
+        is_long(newTime->sec, newTestTime1SecondsTAI, "psTimeMath() returns the correct ->sec");
+        is_long(newTime->nsec, newTestTime1NanosecondsTAI, "psTimeMath() returns the correct ->nsec");
         skip_end();
+
         psFree(newTime);
         psFree(time);
@@ -249,15 +256,16 @@
     {
         psMemId id = psMemGetId();
-        psTime *time = psTimeAlloc(PS_TIME_UTC);
+        psTime *time = psTimeAlloc(PS_TIME_TT);
         time->sec = testTime1SecondsTT;
         time->nsec = testTime1NanosecondsTT;
-        time->type = PS_TIME_TT;
+
         psTime *newTime = psTimeMath(time,deltaTime2);
         ok(newTime != NULL, "psTimeMath() returns non-NULL for allowable time input (PS_TIME_TT)");
         skip_start(newTime == NULL, 2, "Skipping tests because psTimeMath() returned NULL");
         ok(newTime->type == PS_TIME_TT, "psTimeMath() returns the correct type (PS_TIME_TT)");
-        ok((newTime->sec == newTestTime1SecondsTT) && (newTime->nsec == newTestTime1NanosecondsTT),
-           "psTimeMath() returns the correct ->sec and ->nsec (PS_TIME_TT)");
+        is_long(newTime->sec, newTestTime1SecondsTT, "psTimeMath() returns the correct ->sec (PS_TIME_TT)");
+        is_long(newTime->nsec, newTestTime1NanosecondsTT, "psTimeMath() returns the correct ->nsec (PS_TIME_TT)");
         skip_end();
+
         psFree(newTime);
         psFree(time);
@@ -270,15 +278,16 @@
     {
         psMemId id = psMemGetId();
-        psTime *time = psTimeAlloc(PS_TIME_UTC);
+        psTime *time = psTimeAlloc(PS_TIME_UT1);
         time->sec = testTime1SecondsUT1;
         time->nsec = testTime1NanosecondsUT1;
-        time->type = PS_TIME_UT1;
+
         psTime *newTime = psTimeMath(time,deltaTime2);
         ok(newTime != NULL, "psTimeMath() returns non-NULL for allowable time input (PS_TIME_UT1)");
         skip_start(newTime == NULL, 2, "Skipping tests because psTimeMath() returned NULL");
         ok(newTime->type == PS_TIME_UT1, "psTimeMath() returns the correct type (PS_TIME_UT1)");
-        ok((newTime->sec == newTestTime1SecondsUT1) && (newTime->nsec == newTestTime1NanosecondsUT1),
-           "psTimeMath() returns the correct ->sec and ->nsec (PS_TIME_UT1)");
+        is_long(newTime->sec, newTestTime1SecondsUT1, "psTimeMath() returns the correct ->sec (PS_TIME_UT1)");
+        is_long(newTime->nsec, newTestTime1NanosecondsUT1, "psTimeMath() returns the correct ->nsec (PS_TIME_UT1)");
         skip_end();
+
         psFree(newTime);
         psFree(time);
@@ -294,12 +303,13 @@
         time->sec = testTime2SecondsUTC;
         time->nsec = testTime2NanosecondsUTC;
-        time->type = PS_TIME_UTC;
-        psTime *newTime = psTimeMath(time,deltaTime3);
+
+        psTime *newTime = psTimeMath(time, deltaTime3);
         ok(newTime != NULL, "psTimeMath() returns non-NULL for allowable time input (PS_TIME_UTC)");
         skip_start(newTime == NULL, 2, "Skipping tests because psTimeMath() returned NULL");
         ok(newTime->type == PS_TIME_UTC, "psTimeMath() returns the correct type (PS_TIME_UTC)");
-        ok((newTime->sec == newTestTime2SecondsUTC) && (newTime->nsec == newTestTime2NanosecondsUTC),
-           "psTimeMath() returns the correct ->sec and ->nsec (PS_TIME_UTC)");
+        is_long(newTime->sec, newTestTime2SecondsUTC, "psTimeMath() returns the correct ->sec (PS_TIME_UTC)");
+        is_long(newTime->nsec, newTestTime2NanosecondsUTC, "psTimeMath() returns the correct ->nsec (PS_TIME_UTC)");
         skip_end();
+
         psFree(newTime);
         psFree(time);
@@ -314,6 +324,8 @@
     {
         psMemId id = psMemGetId();
+
         psF64 delta = psTimeDelta(NULL, NULL);
-        ok(fabs(delta-0.0) < ERROR_TOL, "psTimeDelta(NULL, NULL) returned 0.0");
+        ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(NULL, NULL) returned 0.0");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -327,6 +339,8 @@
         psMemId id = psMemGetId();
         psTime *time1 = psTimeAlloc(PS_TIME_UTC);
+
         psF64 delta = psTimeDelta(time1, NULL);
-        ok(fabs(delta-0.0) < ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0");
+        ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0");
+
         psFree(time1);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -344,6 +358,8 @@
         time1->sec = 0;
         time1->nsec = 2e9;
+
         psF64 delta = psTimeDelta(time1, time2);
-        ok(fabs(delta-0.0) < ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time1 arg");
+        ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time1 arg");
+
         psFree(time1);
         psFree(time2);
@@ -364,6 +380,8 @@
         time2->sec = 0;
         time2->nsec = 2e9;
+
         psF64 delta = psTimeDelta(time1, time2);
-        ok(fabs(delta-0.0) < ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time2 arg");
+        ok_double_tol(delta, 0.0,  ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time2 arg");
+
         psFree(time1);
         psFree(time2);
@@ -386,6 +404,8 @@
         time2->sec = newTestTime1SecondsUTC;
         time2->nsec = newTestTime1NanosecondsUTC;
+
         psF64 delta = psTimeDelta(time1, time2);
-        ok(fabs(delta-0.0) < ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for different time types");
+        ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for different time types");
+
         psFree(time1);
         psFree(time2);
@@ -406,6 +426,8 @@
         time2->sec = newTestTime1SecondsUTC;
         time2->nsec = newTestTime1NanosecondsUTC;
+
         psF64 delta = psTimeDelta(time2, time1);
-        ok(fabs(delta-deltaTime1) < ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+        ok_double_tol(delta, deltaTime1, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+
         psFree(time1);
         psFree(time2);
@@ -427,6 +449,8 @@
         time2->nsec = newTestTime1NanosecondsTT;
         time2->type = PS_TIME_TT;
+
         psF64 delta = psTimeDelta(time2,time1);
-        ok(fabs(delta-deltaTime2) < ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+        ok_double_tol(delta, deltaTime2, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+
         psFree(time1);
         psFree(time2);
@@ -448,6 +472,8 @@
         time2->nsec = newTestTime2NanosecondsUTC;
         time2->type = PS_TIME_UTC;
+        
         psF64 delta = psTimeDelta(time2,time1);
-        ok(fabs(delta-deltaTime3) < ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+        ok_double_tol(delta, deltaTime3, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");
+
         psFree(time1);
         psFree(time2);
