Index: trunk/psLib/test/sysUtils/Makefile
===================================================================
--- trunk/psLib/test/sysUtils/Makefile	(revision 558)
+++ trunk/psLib/test/sysUtils/Makefile	(revision 560)
@@ -3,6 +3,6 @@
 ##  Makefile:   test/sysUtils
 ##
-##  $Revision: 1.5 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-04-30 06:19:57 $
+##  $Revision: 1.6 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-05-01 23:04:35 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -10,4 +10,13 @@
 ###############################################################################
 
+###############################################################################
+#    Note: I added specific entries for the psTrace files.  The reason I did
+#    this was because the generic rules were failing on the existing test
+#    code (and hence, on my tst_psTraceXX.c code as well).  I am tempted to
+#    fix the generic rules, but that might break existing codes.  When this
+#    problem is resolved, I'll remove the specific rules for psTrace.  -GLG
+#    Also, psLogMsg.
+#    Also, psHash.
+###############################################################################
 include ../../src/Makefile.Globals
 
@@ -20,11 +29,14 @@
          atst_psAbort_02    \
          atst_psAbort_03    \
-         tst_psTrace00      \
-         tst_psTrace01      \
-         tst_psTrace02      \
-         tst_psTrace03      \
          tst_psStringCopy
+TARGET_TRACE = tst_psTrace00 tst_psTrace01 tst_psTrace02 tst_psTrace03 \
+               tst_psTrace04
+TARGET_LOGMSG = tst_psLogMsg00 tst_psLogMsg01 tst_psLogMsg02 tst_psLogMsg03
+TARGET_HASH = tst_psHash00 tst_psHash01 tst_psHash02 tst_psHash03 tst_psHash04
 
-all: $(TARGET)
+all:		$(TARGET)
+psTrace:	$(TARGET_TRACE)
+psLogMsg:	$(TARGET_LOGMSG)
+psHash:	$(TARGET_HASH)
 
 tst_psError: tst_psError.o
@@ -37,4 +49,31 @@
 	@echo "    Deleting executable and binary files for 'test/sysUtils'"
 	$(RM) $(TARGET) *.o *.lint
+
+tst_psHash00:	tst_psHash00.c
+	$(CC) tst_psHash00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash00
+
+tst_psHash01:	tst_psHash01.c
+	$(CC) tst_psHash01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash01
+
+tst_psHash02:	tst_psHash02.c
+	$(CC) tst_psHash02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash02
+
+tst_psHash03:	tst_psHash03.c
+	$(CC) tst_psHash03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash03
+
+tst_psHash04:	tst_psHash04.c
+	$(CC) tst_psHash04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash04
+
+tst_psLogMsg00:	tst_psLogMsg00.c
+	$(CC) tst_psLogMsg00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg00
+
+tst_psLogMsg01:	tst_psLogMsg01.c
+	$(CC) tst_psLogMsg01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg01
+
+tst_psLogMsg02:	tst_psLogMsg02.c
+	$(CC) tst_psLogMsg02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg02
+
+tst_psLogMsg03:	tst_psLogMsg03.c
+	$(CC) tst_psLogMsg03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg03
 
 tst_psTrace00:	tst_psTrace00.c
@@ -50,4 +89,7 @@
 	$(CC) tst_psTrace03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace03
 
+tst_psTrace04:	tst_psTrace04.c
+	$(CC) tst_psTrace04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace04
+
 %.o : %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -I$(PSLIB_INCL_DIR) -c -o $@ $<
@@ -60,3 +102,3 @@
 
 distclean:
-	rm DistCleanFiles
+	rm -rf $(TARGET_TRACE) $(TARGET_LOGMSG) $(TARGET_HASH)
Index: trunk/psLib/test/sysUtils/tst_psHash00.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psHash00.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psHash00.c	(revision 560)
@@ -0,0 +1,54 @@
+/*****************************************************************************
+    This code tests whether a hash table be allocated successfully.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+#include "psHash.h"
+#define NUM_HASH_TABLE_BUCKETS 10
+main()
+{
+    psHash *myHashTable = NULL;
+    int testStatus      = true;
+    int i               = 0;
+
+    printPositiveTestHeader(stdout,
+                            "psHash functions",
+                            "psHashAlloc()");
+
+    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
+
+    if (myHashTable == NULL) {
+        fprintf(stderr, "%s: could not allocate a hash table.", __func__);
+        testStatus = false;
+    }
+
+    if (myHashTable->nbucket != NUM_HASH_TABLE_BUCKETS) {
+        fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n",
+                __func__, i);
+        testStatus = false;
+
+    }
+
+    if (myHashTable->buckets == NULL) {
+        fprintf(stderr, "%s: myHashTable->buckets is NULL.\n",
+                __func__, i);
+        testStatus = false;
+
+    }
+
+    for (i=0;i<NUM_HASH_TABLE_BUCKETS;i++) {
+        if (myHashTable->buckets[i] != NULL) {
+            fprintf(stderr, "%s: hash table bucket[%d] not equal to NULL.\n",
+                    __func__, i);
+            testStatus = false;
+        }
+    }
+
+    printFooter(stdout,
+                "psHash functions",
+                "psHashAlloc()",
+                testStatus);
+
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psHash01.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psHash01.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psHash01.c	(revision 560)
@@ -0,0 +1,71 @@
+/*****************************************************************************
+    This code tests whether a hash table be de-allocated successfully.
+ 
+    GUS: figure out how the memory leak detection stuff works, then put it
+    in here.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+#include "psHash.h"
+#define NUM_HASH_TABLE_BUCKETS 100
+int imGlobal = 0;
+
+typedef struct
+{
+    char *name;
+}
+ID;
+static ID *IdAlloc(const char *name)
+{
+    ID *id = psAlloc(sizeof(ID));
+    id->name = psStringCopy(name);
+
+    return id;
+}
+
+static void IdFree(ID *id)
+{
+    imGlobal++;
+    psFree(id->name);
+    psFree(id);
+}
+
+main()
+{
+    psHash *myHashTable = NULL;
+    int testStatus      = true;
+    int i               = 0;
+
+    printPositiveTestHeader(stdout,
+                            "psHash functions",
+                            "psHashFree()");
+
+    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
+    psHashInsert(myHashTable, "ENTRY00", IdAlloc("IDA"),
+                 (void (*)(void *))IdFree);
+    psHashInsert(myHashTable, "ENTRY01", IdAlloc("IDB"),
+                 (void (*)(void *))IdFree);
+    psHashInsert(myHashTable, "ENTRY02", IdAlloc("IDC"),
+                 (void (*)(void *))IdFree);
+    psHashInsert(myHashTable, "ENTRY03", IdAlloc("IDD"),
+                 (void (*)(void *))IdFree);
+    psHashFree(myHashTable, (void (*)(void *))IdFree);
+
+    //
+    // GUS: put some memory leak stuff here.
+    //
+
+    if (imGlobal != 4) {
+        fprintf(stderr, "%s: only (%d/4) entries were freed",
+                __func__, imGlobal);
+        testStatus = false;
+    }
+
+    printFooter(stdout,
+                "psHash functions",
+                "psHashFree()",
+                testStatus);
+
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psHash02.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psHash02.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psHash02.c	(revision 560)
@@ -0,0 +1,71 @@
+/*****************************************************************************
+    This code tests whether hash tables entries can be inserted correctly.
+ 
+    GUS: Add code to test whether duplicates are handled correctly (use a
+    small hast table and lots of keys).
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+#include "psHash.h"
+#define NUM_HASH_TABLE_BUCKETS 100
+int imGlobal = 0;
+
+typedef struct
+{
+    char *name;
+}
+ID;
+static ID *IdAlloc(const char *name)
+{
+    ID *id = psAlloc(sizeof(ID));
+    id->name = psStringCopy(name);
+
+    return id;
+}
+
+static void IdFree(ID *id)
+{
+    imGlobal++;
+    psFree(id->name);
+    psFree(id);
+}
+
+main()
+{
+    psHash *myHashTable = NULL;
+    int testStatus      = true;
+    int i               = 0;
+    ID *id = NULL;
+    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
+    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
+
+    printPositiveTestHeader(stdout,
+                            "psHash functions",
+                            "psHashInsert()");
+
+    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
+    i = 0;
+    while (myKeys[i] != NULL) {
+        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
+                     (void (*)(void *))IdFree);
+        i++;
+    }
+
+    i = 0;
+    while (myKeys[i] != NULL) {
+        id = psHashLookup(myHashTable, myKeys[i]);
+        if (0 != strcmp(myData[i], id->name)) {
+            fprintf(stderr, "%s: Hash table entry for key %s was %s (should be %s).\n",
+                    __func__, myKeys[i], id->name, myData[i]);
+        }
+        i++;
+    }
+
+    printFooter(stdout,
+                "psHash functions",
+                "psHashInsert()",
+                testStatus);
+
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psHash03.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psHash03.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psHash03.c	(revision 560)
@@ -0,0 +1,84 @@
+/*****************************************************************************
+    This code tests whether hash tables entries can be removed correctly.
+ 
+    GUS: Add code to test whether duplicates are handled correctly.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+#include "psHash.h"
+#define NUM_HASH_TABLE_BUCKETS 100
+int imGlobal = 0;
+
+typedef struct
+{
+    char *name;
+}
+ID;
+static ID *IdAlloc(const char *name)
+{
+    ID *id = psAlloc(sizeof(ID));
+    id->name = psStringCopy(name);
+
+    return id;
+}
+
+static void IdFree(ID *id)
+{
+    imGlobal++;
+    psFree(id->name);
+    psFree(id);
+}
+
+main()
+{
+    psHash *myHashTable = NULL;
+    int testStatus      = true;
+    int i               = 0;
+    ID *id = NULL;
+    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
+    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
+
+    printPositiveTestHeader(stdout,
+                            "psHash functions",
+                            "psHashRemove()");
+
+    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
+    i = 0;
+    while (myKeys[i] != NULL) {
+        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
+                     (void (*)(void *))IdFree);
+        i++;
+    }
+
+
+    i = 0;
+    while (myKeys[i] != NULL) {
+        id = psHashLookup(myHashTable, myKeys[i]);
+        if (0 != strcmp(myData[i], id->name)) {
+            fprintf(stderr, "%s: Hash table entry for key %s was %s (should be %s).\n",
+                    __func__, myKeys[i], id->name, myData[i]);
+        }
+        i++;
+    }
+
+
+    i = 0;
+    while (myKeys[i] != NULL) {
+        id = psHashRemove(myHashTable, myKeys[i]);
+        id = psHashLookup(myHashTable, myKeys[i]);
+        if (id != NULL) {
+            fprintf(stderr, "%s: Hash table entry for key %s not removed.\n",
+                    __func__, "IDA");
+        }
+        i++;
+    }
+
+
+    printFooter(stdout,
+                "psHash functions",
+                "psHashRemove()",
+                testStatus);
+
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psHash04.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psHash04.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psHash04.c	(revision 560)
@@ -0,0 +1,62 @@
+/*****************************************************************************
+    This code tests whether the call psHashKeyList() function works.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+#include "psHash.h"
+#define NUM_HASH_TABLE_BUCKETS 100
+int imGlobal = 0;
+
+typedef struct
+{
+    char *name;
+}
+ID;
+static ID *IdAlloc(const char *name)
+{
+    ID *id = psAlloc(sizeof(ID));
+    id->name = psStringCopy(name);
+
+    return id;
+}
+
+static void IdFree(ID *id)
+{
+    imGlobal++;
+    psFree(id->name);
+    psFree(id);
+}
+
+main()
+{
+    psHash *myHashTable = NULL;
+    int testStatus      = true;
+    int i               = 0;
+    ID *id              = NULL;
+    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
+    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
+
+    printPositiveTestHeader(stdout,
+                            "psHash functions",
+                            "psHashKeyList()");
+
+    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
+    i = 0;
+    while (myKeys[i] != NULL) {
+        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
+                     (void (*)(void *))IdFree);
+        i++;
+    }
+
+    //
+    // GUS: add call to psHashKeyList()
+    //
+
+    printFooter(stdout,
+                "psHash functions",
+                "psHashKeyList()",
+                testStatus);
+
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psLogMsg00.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psLogMsg00.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psLogMsg00.c	(revision 560)
@@ -0,0 +1,29 @@
+/*****************************************************************************
+    This code tests whether trace levels can be set successfully.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+
+main()
+{
+    int i = 0;
+    int lev = 0;
+    int testStatus = true;
+
+    printPositiveTestHeader(stdout,
+                            "psLogMsg functions",
+                            "default log levels");
+
+    // Send a log messages for levels 0:9.  Only the first four messages
+    // should actually be displayed.
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printFooter(stdout,
+                "psLogMsg functions",
+                "default log levels",
+                testStatus);
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psLogMsg01.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psLogMsg01.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psLogMsg01.c	(revision 560)
@@ -0,0 +1,37 @@
+/*****************************************************************************
+    This code tests whether trace levels can be set successfully.
+ 
+ NOTE: This code must be modified once printFooter() is modified to include
+ a parameter that indicates we don't know whether the test passed or failed.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+
+main()
+{
+    int i = 0;
+    int lev = 0;
+    int testStatus = true;
+
+    printPositiveTestHeader(stdout,
+                            "psLogMsg functions",
+                            "psSetLogLevel()");
+
+    psSetLogLevel(9);
+    // Send a log messages for levels 0:9.
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    psSetLogLevel(5);
+    psLogMsg(__func__, 6, "This should not be displayed (level %d)\n", 6);
+    psSetLogLevel(4);
+    psLogMsg(__func__, 4, "This should  be displayed (level %d)\n", 4);
+
+    printFooter(stdout,
+                "psLogMsg functions",
+                "psSetLogLevel()",
+                testStatus);
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psLogMsg02.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psLogMsg02.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psLogMsg02.c	(revision 560)
@@ -0,0 +1,69 @@
+/*****************************************************************************
+    This code tests whether the log message format can be set.
+ 
+ NOTE: This code must be modified once printFooter() is modified to include
+ a parameter that indicates we don't know whether the test passed or failed.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+
+main()
+{
+    int i = 0;
+    int lev = 0;
+    int testStatus = true;
+
+    printPositiveTestHeader(stdout,
+                            "psLogMsg functions",
+                            "psSetLogFormat()");
+
+
+    printf("------------- psSetLogFormat() -------------\n");
+    psSetLogFormat("");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(T) -------------\n");
+    psSetLogFormat("T");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(H) -------------\n");
+    psSetLogFormat("H");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(L) -------------\n");
+    psSetLogFormat("L");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(N) -------------\n");
+    psSetLogFormat("N");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(M) -------------\n");
+    psSetLogFormat("M");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogFormat(THLNM) -------------\n");
+    psSetLogFormat("THLNM");
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printFooter(stdout,
+                "psLogMsg functions",
+                "psSetLogFormat()",
+                testStatus);
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psLogMsg03.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psLogMsg03.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psLogMsg03.c	(revision 560)
@@ -0,0 +1,45 @@
+/*****************************************************************************
+    This code tests whether the log message can be redirected to STDERR or
+    STDOUT.
+ 
+ NOTE: This code must be modified once printFooter() is modified to include
+ a parameter that indicates we don't know whether the test passed or failed.
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+
+main()
+{
+    int i = 0;
+    int lev = 0;
+    int testStatus = true;
+
+    printPositiveTestHeader(stdout,
+                            "psLogMsg functions",
+                            "psSetLogDestination()");
+
+    printf("------------- psSetLogDestination(PS_LOG_NONE) -------------\n");
+    psSetLogDestination(PS_LOG_NONE);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogDestination(PS_LOG_TO_STDERR) -------------\n");
+    psSetLogDestination(PS_LOG_TO_STDERR);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printf("------------- psSetLogDestination(PS_LOG_TO_STDOUT) -------------\n");
+    psSetLogDestination(PS_LOG_TO_STDERR);
+    for (i=0;i<10;i++) {
+        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
+    }
+
+    printFooter(stdout,
+                "psLogMsg functions",
+                "psSetLogDestination()",
+                testStatus);
+    exit(!testStatus);
+}
Index: trunk/psLib/test/sysUtils/tst_psTrace00.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psTrace00.c	(revision 558)
+++ trunk/psLib/test/sysUtils/tst_psTrace00.c	(revision 560)
@@ -10,9 +10,9 @@
     int i = 0;
     int lev = 0;
-    int errorFlag = true;
+    int testStatus = true;
 
-    printPositiveTestHeader(stderr,
+    printPositiveTestHeader(stdout,
                             "psTrace functions",
-                            "Testing psSetTraceLevel and psGetTraceLevel");
+                            "psSetTraceLevel() and psGetTraceLevel()");
     for (i=0;i<10;i++) {
         psSetTraceLevel(".", i);
@@ -21,5 +21,5 @@
             printf("ERROR: (.) expected trace level was %d, actual was %d\n",
                    i, lev);
-            errorFlag = false;
+            testStatus = false;
         }
     }
@@ -32,5 +32,5 @@
             printf("ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
                    i, lev);
-            errorFlag = false;
+            testStatus = false;
         }
 
@@ -39,5 +39,5 @@
             printf("ERROR: (.) expected trace level was %d, actual was %d\n",
                    i, 3);
-            errorFlag = false;
+            testStatus = false;
         }
     }
@@ -51,12 +51,12 @@
             printf("ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
                    i, lev);
-            errorFlag = false;
+            testStatus = false;
         }
     }
 
-    printFooter(stderr,
+    printFooter(stdout,
                 "psTrace functions",
                 "Testing psSetTraceLevel and psGetTraceLevel",
-                errorFlag);
-    exit(0);
+                testStatus);
+    exit(!testStatus);
 }
Index: trunk/psLib/test/sysUtils/tst_psTrace01.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psTrace01.c	(revision 558)
+++ trunk/psLib/test/sysUtils/tst_psTrace01.c	(revision 560)
@@ -12,7 +12,7 @@
     int successFlag = true;
 
-    printPositiveTestHeader(stderr,
+    printPositiveTestHeader(stdout,
                             "psTrace functions",
-                            "Testing psTraceReset()");
+                            "psTraceReset()");
 
     for (i=0;i<10;i++) {
@@ -21,5 +21,5 @@
 
         lev = psGetTraceLevel(".");
-        if (lev != UNKNOWN_TRACE_LEVEL) {
+        if (lev != DEFAULT_TRACE_LEVEL) {
             printf("ERROR: expected trace level was %d, actual was %d\n",
                    i, lev);
@@ -32,16 +32,17 @@
     psSetTraceLevel(".a.b.c", 2);
     psTraceReset();
-    if ((UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".")) ||
-            (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a")) ||
-            (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a.b")) ||
-            (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a.b.c"))) {
+    if ((DEFAULT_TRACE_LEVEL != psGetTraceLevel(".")) ||
+            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a")) ||
+            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a.b")) ||
+            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a.b.c"))) {
         printf("ERROR: trace levels were not reset properly\n");
         successFlag = false;
     }
 
-    printFooter(stderr,
+    printFooter(stdout,
                 "psTrace functions",
-                "Testing psTraceReset()",
+                "psTraceReset()",
                 successFlag);
-    exit(0);
+
+    exit(!successFlag);
 }
Index: trunk/psLib/test/sysUtils/tst_psTrace02.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psTrace02.c	(revision 558)
+++ trunk/psLib/test/sysUtils/tst_psTrace02.c	(revision 560)
@@ -12,4 +12,8 @@
     int lev = 0;
     int errorFlag = 0;
+
+    printPositiveTestHeader(stdout,
+                            "psTrace functions",
+                            "psTrace()");
 
     psSetTraceLevel(".", 4);
@@ -35,4 +39,9 @@
             0xbeefface);
 
+    printFooter(stdout,
+                "psTrace functions",
+                "psTrace()",
+                true);
+
     exit(0);
 }
Index: trunk/psLib/test/sysUtils/tst_psTrace03.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psTrace03.c	(revision 558)
+++ trunk/psLib/test/sysUtils/tst_psTrace03.c	(revision 560)
@@ -9,4 +9,8 @@
 main()
 {
+    printPositiveTestHeader(stdout,
+                            "psTrace functions",
+                            "psTracePrintLevels()");
+
     psSetTraceLevel(".", 9);
 
@@ -26,4 +30,10 @@
 
     psPrintTraceLevels();
+
+    printFooter(stdout,
+                "psTrace functions",
+                "psTracePrintLevels()",
+                true);
+
     exit(0);
 }
Index: trunk/psLib/test/sysUtils/tst_psTrace04.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psTrace04.c	(revision 560)
+++ trunk/psLib/test/sysUtils/tst_psTrace04.c	(revision 560)
@@ -0,0 +1,55 @@
+/*****************************************************************************
+    This code tests whether trace messages can be printed successfully
+    with psPrintTraceLevels().
+ *****************************************************************************/
+#include <stdio.h>
+#include "pslib.h"
+#include "psTest.h"
+
+main()
+{
+    printPositiveTestHeader(stdout,
+                            "psTrace functions",
+                            "Testing psTraceReset()");
+    psSetTraceLevel(".", 9);
+
+    psSetTraceLevel(".a", 8);
+    psSetTraceLevel(".b", 7);
+    psSetTraceLevel(".c", 5);
+
+    psSetTraceLevel(".a.a", 4);
+    psSetTraceLevel(".a.b", 3);
+
+    psSetTraceLevel(".b.a", 2);
+    psSetTraceLevel(".b.b", 1);
+
+    psSetTraceLevel(".c.a", 0);
+    psSetTraceLevel(".c.b", 3);
+    psSetTraceLevel(".c.c", 5);
+
+    psTraceReset();
+
+    if (psGetTraceLevel(".") ||
+            psGetTraceLevel(".a") ||
+            psGetTraceLevel(".b") ||
+            psGetTraceLevel(".c") ||
+            psGetTraceLevel(".a.a") ||
+            psGetTraceLevel(".a.b") ||
+            psGetTraceLevel(".b.a") ||
+            psGetTraceLevel(".b.b") ||
+            psGetTraceLevel(".c.a") ||
+            psGetTraceLevel(".c.b") ||
+            psGetTraceLevel(".c.c")) {
+        printFooter(stdout,
+                    "psTrace functions",
+                    "psTraceReset() did not reset all levels of the tree.",
+                    false);
+        exit(1);
+    } else {
+        printFooter(stdout,
+                    "psTrace functions",
+                    "psTraceReset()",
+                    true);
+        exit(0);
+    }
+}
Index: trunk/psLib/test/sysUtils/verified/tst_psHash00.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psHash00.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psHash00.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psHash00.c                                             |
+|  TestPoint: psHash functions{psHashAlloc()}                            |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashAlloc()} | tst_psHash00.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psHash01.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psHash01.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psHash01.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psHash01.c                                             |
+|  TestPoint: psHash functions{psHashFree()}                             |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashFree()} | tst_psHash01.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psHash02.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psHash02.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psHash02.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psHash02.c                                             |
+|  TestPoint: psHash functions{psHashInsert()}                           |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashInsert()} | tst_psHash02.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psHash03.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psHash03.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psHash03.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psHash03.c                                             |
+|  TestPoint: psHash functions{psHashRemove()}                           |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashRemove()} | tst_psHash03.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psHash04.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psHash04.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psHash04.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psHash04.c                                             |
+|  TestPoint: psHash functions{psHashKeyList()}                          |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashKeyList()} | tst_psHash04.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stderr	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stderr	(revision 560)
@@ -0,0 +1,4 @@
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |A|main           |Hello World!  My level is 0
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |E|main           |Hello World!  My level is 1
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |W|main           |Hello World!  My level is 2
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |I|main           |Hello World!  My level is 3
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg00.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psLogMsg00.c                                           |
+|  TestPoint: psLogMsg functions{default log levels}                     |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psLogMsg functions{default log levels} | tst_psLogMsg00.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stderr	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stderr	(revision 560)
@@ -0,0 +1,11 @@
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |A|main           |Hello World!  My level is 0
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |E|main           |Hello World!  My level is 1
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |W|main           |Hello World!  My level is 2
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |I|main           |Hello World!  My level is 3
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |4|main           |Hello World!  My level is 4
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |5|main           |Hello World!  My level is 5
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |6|main           |Hello World!  My level is 6
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |7|main           |Hello World!  My level is 7
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |8|main           |Hello World!  My level is 8
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |9|main           |Hello World!  My level is 9
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |4|main           |This should  be displayed (level 4)
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg01.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psLogMsg01.c                                           |
+|  TestPoint: psLogMsg functions{psSetLogLevel()}                        |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psLogMsg functions{psSetLogLevel()} | tst_psLogMsg01.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stderr	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stderr	(revision 560)
@@ -0,0 +1,28 @@
+
+
+
+
+2004:05:01 23:10:09Z|
+2004:05:01 23:10:09Z|
+2004:05:01 23:10:09Z|
+2004:05:01 23:10:09Z|
+kitty.mhpcc.hpc.mil |
+kitty.mhpcc.hpc.mil |
+kitty.mhpcc.hpc.mil |
+kitty.mhpcc.hpc.mil |
+A|
+E|
+W|
+I|
+main           |
+main           |
+main           |
+main           |
+Hello World!  My level is 0
+Hello World!  My level is 1
+Hello World!  My level is 2
+Hello World!  My level is 3
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |A|main           |Hello World!  My level is 0
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |E|main           |Hello World!  My level is 1
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |W|main           |Hello World!  My level is 2
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |I|main           |Hello World!  My level is 3
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg02.stdout	(revision 560)
@@ -0,0 +1,16 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psLogMsg02.c                                           |
+|  TestPoint: psLogMsg functions{psSetLogFormat()}                       |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+------------- psSetLogFormat() -------------
+------------- psSetLogFormat(T) -------------
+------------- psSetLogFormat(H) -------------
+------------- psSetLogFormat(L) -------------
+------------- psSetLogFormat(N) -------------
+------------- psSetLogFormat(M) -------------
+------------- psSetLogFormat(THLNM) -------------
+
+---> TESTPOINT PASSED (psLogMsg functions{psSetLogFormat()} | tst_psLogMsg02.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stderr	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stderr	(revision 560)
@@ -0,0 +1,8 @@
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |A|main           |Hello World!  My level is 0
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |E|main           |Hello World!  My level is 1
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |W|main           |Hello World!  My level is 2
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |I|main           |Hello World!  My level is 3
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |A|main           |Hello World!  My level is 0
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |E|main           |Hello World!  My level is 1
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |W|main           |Hello World!  My level is 2
+2004:05:01 23:10:09Z|kitty.mhpcc.hpc.mil |I|main           |Hello World!  My level is 3
Index: trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psLogMsg03.stdout	(revision 560)
@@ -0,0 +1,12 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psLogMsg03.c                                           |
+|  TestPoint: psLogMsg functions{psSetLogDestination()}                  |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+------------- psSetLogDestination(PS_LOG_NONE) -------------
+------------- psSetLogDestination(PS_LOG_TO_STDERR) -------------
+------------- psSetLogDestination(PS_LOG_TO_STDOUT) -------------
+
+---> TESTPOINT PASSED (psLogMsg functions{psSetLogDestination()} | tst_psLogMsg03.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace00.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace00.stderr	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace00.stderr	(revision 560)
@@ -1,9 +1,0 @@
-/----------------------------- TESTPOINT --------------------------------\
-|   TestFile: tst_psTrace00.c                                            |
-|  TestPoint: psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} |
-|   TestType: Positive                                                   |
-\------------------------------------------------------------------------/
-
-
----> TESTPOINT PASSED (psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} | tst_psTrace00.c)
-
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace00.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace00.stdout	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace00.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psTrace00.c                                            |
+|  TestPoint: psTrace functions{psSetTraceLevel() and psGetTraceLevel()} |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} | tst_psTrace00.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace01.stderr
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace01.stderr	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace01.stderr	(revision 560)
@@ -1,9 +1,0 @@
-/----------------------------- TESTPOINT --------------------------------\
-|   TestFile: tst_psTrace01.c                                            |
-|  TestPoint: psTrace functions{Testing psTraceReset()}                  |
-|   TestType: Positive                                                   |
-\------------------------------------------------------------------------/
-
-
----> TESTPOINT PASSED (psTrace functions{Testing psTraceReset()} | tst_psTrace01.c)
-
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace01.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace01.stdout	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace01.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psTrace01.c                                            |
+|  TestPoint: psTrace functions{psTraceReset()}                          |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psTrace functions{psTraceReset()} | tst_psTrace01.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace02.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace02.stdout	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace02.stdout	(revision 560)
@@ -1,3 +1,12 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psTrace02.c                                            |
+|  TestPoint: psTrace functions{psTrace()}                               |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
      (0) This message should be displayed (beefface)
      (1) This message should be displayed (beefface)
      (2) This message should be displayed (beefface)
+
+---> TESTPOINT PASSED (psTrace functions{psTrace()} | tst_psTrace02.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace03.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace03.stdout	(revision 558)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace03.stdout	(revision 560)
@@ -1,2 +1,8 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psTrace03.c                                            |
+|  TestPoint: psTrace functions{psTracePrintLevels()}                    |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
 .                    9
  a                   8
@@ -10,2 +16,5 @@
   b                  3
   c                  5
+
+---> TESTPOINT PASSED (psTrace functions{psTracePrintLevels()} | tst_psTrace03.c)
+
Index: trunk/psLib/test/sysUtils/verified/tst_psTrace04.stdout
===================================================================
--- trunk/psLib/test/sysUtils/verified/tst_psTrace04.stdout	(revision 560)
+++ trunk/psLib/test/sysUtils/verified/tst_psTrace04.stdout	(revision 560)
@@ -0,0 +1,9 @@
+/----------------------------- TESTPOINT --------------------------------\
+|   TestFile: tst_psTrace04.c                                            |
+|  TestPoint: psTrace functions{Testing psTraceReset()}                  |
+|   TestType: Positive                                                   |
+\------------------------------------------------------------------------/
+
+
+---> TESTPOINT PASSED (psTrace functions{psTraceReset()} | tst_psTrace04.c)
+
