Index: /trunk/psLib/test/collections/tst_psHash02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psHash02.c	(revision 2621)
+++ /trunk/psLib/test/collections/tst_psHash02.c	(revision 2622)
@@ -49,7 +49,5 @@
     psS32 memLeaks        = 0;
 
-    printPositiveTestHeader(stdout,
-                            "psHash functions",
-                            "psHashAdd()");
+    printPositiveTestHeader(stdout,"psHash functions","psHashLookup");
 
     myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
@@ -68,14 +66,40 @@
             fprintf(stderr, "%s: Hash table entry for key %s was %s (should be %s).\n",
                     __func__, myKeys[i], id->name, myData[i]);
+            return 1;
         }
         i++;
     }
+    printFooter(stdout,"psHash functions","psHashLookup",true);
+
+    // Use an invalid key in the hash table: verify no item is returned
+    printNegativeTestHeader(stdout,"psHashLookup","Invalid key","Key is not found in the table",0);
     id = psHashLookup(myHashTable, "BogusKey");
     if (id != NULL) {
         fprintf(stderr, "%s: Hash table entry for key %s was not NULL.\n",
                 __func__, "BogusKey");
+        return 2;
     }
+    printFooter(stdout,"psHashLookup","Invalid key",true);
 
-    //    psHashFree(myHashTable, NULL);
+    // Lookup with null table
+    printNegativeTestHeader(stdout,"psHashLookup","NULL table","Can not lookup with NULL table",0);
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashLookup with null table");
+    id = psHashLookup(NULL,"ENTRY01");
+    if (id != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psHashLookup retrieved an entry from NULL hash table.");
+        return 3;
+    }
+    printFooter(stdout,"psHashLookup","NULL table",true);
+
+    // Lookup with null key
+    printNegativeTestHeader(stdout,"psHashLookup","NULL key","Can not lookup with NULL key.",0);
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashLookup with null key");
+    id = psHashLookup(myHashTable,NULL);
+    if (id != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psHashLookup retrieved an entry with NULL key.");
+        return 4;
+    }
+    printFooter(stdout,"psHashLookup","NULL key",true);
+
     psFree(myHashTable);
 
@@ -86,9 +110,4 @@
     psMemCheckCorruption(1);
 
-    printFooter(stdout,
-                "psHash functions",
-                "psHashAdd()",
-                testStatus);
-
     return (!testStatus);
 }
Index: /trunk/psLib/test/collections/verified/tst_psHash02.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psHash02.stderr	(revision 2621)
+++ /trunk/psLib/test/collections/verified/tst_psHash02.stderr	(revision 2622)
@@ -0,0 +1,8 @@
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message: psHashLookup with null table
+<DATE><TIME>|<HOST>|E|psHashLookup (psHash.c:<LINENO>)
+    Input psHash can not be NULL.
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message: psHashLookup with null key
+<DATE><TIME>|<HOST>|E|psHashLookup (psHash.c:<LINENO>)
+    Input key can not be NULL.
Index: /trunk/psLib/test/collections/verified/tst_psHash02.stdout
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psHash02.stdout	(revision 2622)
+++ /trunk/psLib/test/collections/verified/tst_psHash02.stdout	(revision 2622)
@@ -0,0 +1,42 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psHash02.c                                             *
+*            TestPoint: psHash functions{psHashLookup}                             *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psHash functions{psHashLookup} | tst_psHash02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psHash02.c                                             *
+*            TestPoint: psHashLookup{Invalid key}                                  *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Key is not found in the table                              *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psHashLookup{Invalid key} | tst_psHash02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psHash02.c                                             *
+*            TestPoint: psHashLookup{NULL table}                                   *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Can not lookup with NULL table                             *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psHashLookup{NULL table} | tst_psHash02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psHash02.c                                             *
+*            TestPoint: psHashLookup{NULL key}                                     *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Can not lookup with NULL key.                              *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psHashLookup{NULL key} | tst_psHash02.c)
+
