Index: /trunk/psLib/test/dataIO/tst_psDB.c
===================================================================
--- /trunk/psLib/test/dataIO/tst_psDB.c	(revision 4256)
+++ /trunk/psLib/test/dataIO/tst_psDB.c	(revision 4257)
@@ -9,6 +9,6 @@
  *  @author Aaron Culliney, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-03 23:46:07 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 01:02:08 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -98,6 +98,5 @@
     psDB *dbh = NULL;
 
-    psLogMsg( __func__, PS_LOG_INFO, "initialize database connection...\n" );
-
+    // Initialize database connection with test database
     dbh = psDBInit(host, user, passwd, dbname);
     if (dbh == NULL) {
@@ -290,20 +289,30 @@
 }
 
-// Testpoint #XXX, initialize/break-down MySQL connection.
+// Testpoint #841, initialize/break-down MySQL connection.
 psS32 TPDBInit( void )
 {
-    psS32 failed = 0;
-    psDB *dbh = NULL;
-
-    psLogMsg( __func__, PS_LOG_INFO, "psDBInit/psDBCleanup shall initialize/cleanup database connection.\n" );
-
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        return 1;
-    }
-
-    psDBCleanup(dbh);
-
-    return failed;
+    psDB *dbh = NULL;
+
+    // Initialize database with valid arguments
+    dbh = _init_psDB();
+    if (dbh == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL to be returned for valid arguments");
+        return 1;
+    }
+
+    // Cleanup database/connection with valid psDB object
+    psDBCleanup(dbh);
+
+    // Attempt to initialize database with invalid arguments
+    dbh = psDBInit("xxx",NULL,NULL,NULL);
+    if(dbh != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL psDB with invalid arguments");
+        return 2;
+    }
+
+    // Attempt cleanup database/connection with NULL psDB object
+    psDBCleanup(NULL);
+
+    return 0;
 }
 
Index: /trunk/psLib/test/dataIO/verified/tst_psDB.stderr
===================================================================
--- /trunk/psLib/test/dataIO/verified/tst_psDB.stderr	(revision 4256)
+++ /trunk/psLib/test/dataIO/verified/tst_psDB.stderr	(revision 4257)
@@ -5,8 +5,8 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|TPDBInit
-    psDBInit/psDBCleanup shall initialize/cleanup database connection.
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
+<DATE><TIME>|<HOST>|E|psDBInit (FILE:LINENO)
+    Failed to connect to database.  Error: Unknown MySQL server host 'xxx' (1)
+<DATE><TIME>|<HOST>|E|psDBCleanup (FILE:LINENO)
+    Invalid psDB has been specified.
 
 ---> TESTPOINT PASSED (psDB{dbInit} | tst_psDB.c)
@@ -18,6 +18,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBChange
     psDBChange shall change to a new test database.
@@ -31,6 +29,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBCreateTable
     psDBCreateTable shall create a new table in the new test database.
@@ -44,6 +40,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBDropTable
     psDBDropTable shall create/drop a new table in the new test database.
@@ -63,6 +57,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBSelectColumn
     psDBSelectColumn shall select data from a test table.
@@ -92,6 +84,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBSelectColumnNum
     psDBSelectColumnNum shall select data from a test table.
@@ -121,6 +111,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBSelectRows
     psDBSelectRows shall select data from a test table.
@@ -166,6 +154,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBInsertOneRow
     psDBInsertOneRow shall insert a row into a test table.
@@ -179,6 +165,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBInsertRows
     psDBInsertRows shall insert rows into a test table.
@@ -232,6 +216,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBDumpRows
     psDBDumpRows shall dump all rows from a test table.
@@ -285,10 +267,8 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBDumpCols
     psDBDumpCols shall dump all cols from a test table.
 <DATE><TIME>|<HOST>|I|_print_row
-    [key_string]=[]
+    [key_string]=[]
 
 ---> TESTPOINT PASSED (psDB{dbDumpCols} | tst_psDB.c)
@@ -300,6 +280,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBUpdateRows
     psDBUpdateRows shall update rows in a test table.
@@ -329,6 +307,4 @@
 \**********************************************************************************/
 
-<DATE><TIME>|<HOST>|I|_init_psDB
-    initialize database connection...
 <DATE><TIME>|<HOST>|I|TPDBDeleteRows
     psDBDeleteRows shall delete rows from a test table.
