Index: /trunk/psLib/test/astro/tap_psTime_02.c
===================================================================
--- /trunk/psLib/test/astro/tap_psTime_02.c	(revision 12412)
+++ /trunk/psLib/test/astro/tap_psTime_02.c	(revision 12413)
@@ -12,6 +12,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-12 21:00:25 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-03-13 00:02:14 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,5 +20,7 @@
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 #include <pslib.h>
+
 #include "tap.h"
 #include "pstap.h"
@@ -49,9 +51,9 @@
 const psU32 testTime3NanosecondsUTC = 0;
 
-psS32 main(psS32 argc, char* argv[])
+int main(int argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
     psLogSetFormat("HLNM");
-    plan_tests(50);
+    plan_tests(54);
     psLibInit("pslib.config");
 
@@ -62,6 +64,8 @@
     {
         psMemId id = psMemGetId();
+
         psF64 lmst = psTimeToLMST(NULL, 0);
-        ok(isnan(lmst), "psTimeToLMST(time,0) returned NULL");
+        ok_double(lmst, NAN, "psTimeToLMST(time,0) returned NAN");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -76,6 +80,8 @@
         time->nsec = testTime1NanosecondsUTC;
         time->leapsecond = false;
+
         psF64 lmst = psTimeToLMST(time, 0.0);
-        ok(fabs(lmst-testTime1LMST0) < ERROR_TOL, "psTimeToLMST() returned the correct time");
+        ok_double_tol(lmst, testTime1LMST0, ERROR_TOL, "psTimeToLMST() returned the correct time");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -94,6 +100,8 @@
         time->leapsecond = false;
         time->type = PS_TIME_UT1;
+
         psF64 lmst = psTimeToLMST(time,0.0);
-        ok(isnan(lmst), "psTimeToLMST() generated a NAN for incorrect type");
+        ok_double(lmst, NAN, "psTimeToLMST() generated a NAN for incorrect type");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -107,6 +115,8 @@
     {
         psMemId id = psMemGetId();
+
         psS64 delta = psTimeLeapSecondDelta(NULL, NULL);
-        ok(delta == 0, "psTimeLeapSecondDelta(NULL, NULL) returned 0");
+        is_long(delta, 0, "psTimeLeapSecondDelta(NULL, NULL) returned 0");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -125,5 +135,6 @@
 
         psS64 delta = psTimeLeapSecondDelta(time1, NULL);
-        ok(delta == 0, "psTimeLeapSecondDelta(time1, NULL) returned 0");
+        is_long(delta, 0, "psTimeLeapSecondDelta(time1, NULL) returned 0");
+
         psFree(time1);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -146,6 +157,7 @@
         time2->leapsecond = false;
 
-        psS64 delta = psTimeLeapSecondDelta(time1,time2);
-        ok(delta == 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time2");
+        psS64 delta = psTimeLeapSecondDelta(time1, time2);
+        is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time2");
+
         psFree(time1);
         psFree(time2);
@@ -171,5 +183,6 @@
 
         psS64 delta = psTimeLeapSecondDelta(time1,time2);
-        ok(delta == 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time1");
+        is_long(delta, 0, "psTimeLeapSecondDelta(time1, time2) returned 0 with incorrect time1");
+
         psFree(time1);
         psFree(time2);
@@ -191,5 +204,6 @@
 
         psS64 delta = psTimeLeapSecondDelta(time1,time2);
-        ok(delta == testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
+        is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
+
         psFree(time1);
         psFree(time2);
@@ -208,6 +222,8 @@
         time2->sec = testTime2SecondsUTC;
         time2->nsec = testTime2NanosecondsUTC;
-        psS64 delta = psTimeLeapSecondDelta(time2,time1);
-        ok(delta == testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
+
+        psS64 delta = psTimeLeapSecondDelta(time2, time1);
+        is_long(delta, testTimeLeapSecondDelta1, "psTimeLeapSecondDelta() produced the correct result");
+
         psFree(time1);
         psFree(time2);
@@ -225,5 +241,6 @@
 
         psS64 delta = psTimeLeapSecondDelta(time1,time1);
-        ok(delta == 0, "psTimeLeapSecondDelta() produced the correct result");
+        is_long(delta, 0, "psTimeLeapSecondDelta() produced the correct result");
+
         psFree(time1);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -237,6 +254,8 @@
     {
         psMemId id = psMemGetId();
-        psBool leapsecond = psTimeIsLeapSecond(NULL);
-        ok(!leapsecond, "psTimeIsLeapSecond(NULL) returned correct value");
+
+        bool leapsecond = psTimeIsLeapSecond(NULL);
+        is_bool(leapsecond, false, "psTimeIsLeapSecond(NULL) returned correct value");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -254,6 +273,8 @@
         time->nsec = testTime1NanosecondsUTC;
         time->leapsecond = false;
-        psBool leapsecond = psTimeIsLeapSecond(time);
-        ok(!leapsecond, "psTimeIsLeapSecond() returned false with incorrect type");
+
+        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");
@@ -271,6 +292,8 @@
         time->leapsecond = false;
         time->type = PS_TIME_UTC;
-        psBool leapsecond = psTimeIsLeapSecond(time);
-        ok(!leapsecond, "psTimeIsLeapSecond() returned false");
+
+        bool leapsecond = psTimeIsLeapSecond(time);
+        is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -286,6 +309,8 @@
         time->sec = testTime3SecondsUTC;
         time->nsec = testTime3NanosecondsUTC;
-        psBool leapsecond = psTimeIsLeapSecond(time);
-        ok(leapsecond, "psTimeIsLeapSecond() returned true");
+
+        bool leapsecond = psTimeIsLeapSecond(time);
+        is_bool(leapsecond, true, "psTimeIsLeapSecond() returned true");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -302,6 +327,8 @@
         time->nsec = testTime3NanosecondsUTC;
         time->sec--;
-        psBool leapsecond = psTimeIsLeapSecond(time);
-        ok(!leapsecond, "psTimeIsLeapSecond() returned false");
+
+        bool leapsecond = psTimeIsLeapSecond(time);
+        is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -317,6 +344,8 @@
         time->nsec = testTime3NanosecondsUTC;
         time->sec ++;
-        psBool leapsecond = psTimeIsLeapSecond(time);
-        ok(!leapsecond, "psTimeIsLeapSecond() returned false");
+
+        bool leapsecond = psTimeIsLeapSecond(time);
+        is_bool(leapsecond, false, "psTimeIsLeapSecond() returned false");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -330,6 +359,8 @@
     {
         psMemId id = psMemGetId();
+
         psTime *time = psTimeFromTT(0,2e9);
         ok(time == NULL, "psTimeFromTT() returned NULL with incorrect time");
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -341,4 +372,5 @@
     {
         psMemId id = psMemGetId();
+
         psTime *time = psTimeFromTT(testTime1SecondsUTC,testTime1NanosecondsUTC);
         ok(time != NULL, "psTimeFromTT() returned non-NULL with valid time");
@@ -346,7 +378,9 @@
 
         ok(time->type == PS_TIME_TT, "psTimeFromTT() returned correct type");
-        ok((time->sec == testTime1SecondsUTC) && (time->nsec == testTime1NanosecondsUTC),
-           "psTimeFromTT() returned correct ->sec and ->nsec");
+        is_long(time->sec, testTime1SecondsUTC, "psTimeFromTT() returned correct ->sec"); 
+        is_long(time->nsec, testTime1NanosecondsUTC, "psTimeFromTT() returned correct ->nsec");
+        is_bool(time->leapsecond, false, "psTimeFromUTC() returned the correct leapsecond flag");
         skip_end();
+
         psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -360,6 +394,8 @@
     {
         psMemId id = psMemGetId();
+
         psTime *time = psTimeFromUTC(0, 2e9, true);
         ok(time == NULL, "psTimeFromUTC() returned NULL with incorrect time input");
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -374,9 +410,10 @@
         skip_start(time == NULL, 3, "Skipping tests because psTimeFromUTC() returned NULL");
         ok(time->type == PS_TIME_UTC, "psTimeFromUTC() returned the correct type");
-        ok((time->sec == testTime1SecondsUTC) && (time->nsec == testTime1NanosecondsUTC),
-           "psTimeFromUTC() returned the correct ->sec and ->nsec");
-        ok(!time->leapsecond, "psTimeFromUTC() returned the correct leapsecond flag");
-        psFree(time);
+        is_long(time->sec, testTime1SecondsUTC, "psTimeFromUTC() returned the correct ->sec and ->nsec");
+        is_long(time->nsec, testTime1NanosecondsUTC, "psTimeFromUTC() returned the correct ->sec and ->nsec");
+        is_bool(time->leapsecond, false, "psTimeFromUTC() returned the correct leapsecond flag");
         skip_end();
+
+        psFree(time);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -387,13 +424,15 @@
     {
         psMemId id = psMemGetId();
+
         psTime *time = psTimeFromUTC(testTime3SecondsUTC, testTime3NanosecondsUTC, false);
         ok(time != NULL, "psTimeFromUTC() returned non-NULL with correct input");
         skip_start(time == NULL, 5, "Skipping tests because psTimeFromUTC() returned NULL");
         ok(time->type == PS_TIME_UTC, "psTimeFromUTC() returned the correct type");
-        ok((time->sec == testTime3SecondsUTC) && (time->nsec == testTime3NanosecondsUTC),
-           "psTimeFromUTC() returned the correct ->sec and ->nsec");
-        ok(time->leapsecond, "psTimeFromUTC() returned the correct leapsecond flag");
+        is_long(time->sec, testTime3SecondsUTC, "psTimeFromUTC() returned the correct ->sec");
+        is_long(time->nsec, testTime3NanosecondsUTC, "psTimeFromUTC() returned the correct ->nsec");
+        is_bool(time->leapsecond, true, "psTimeFromUTC() returned the correct leapsecond flag");
         psFree(time);
         skip_end();
+
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
