Index: trunk/psLib/test/dataIO/tst_psDB.c
===================================================================
--- trunk/psLib/test/dataIO/tst_psDB.c	(revision 4263)
+++ trunk/psLib/test/dataIO/tst_psDB.c	(revision 4270)
@@ -9,6 +9,6 @@
  *  @author Aaron Culliney, MHPCC
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 01:48:25 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-15 03:20:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -72,5 +72,5 @@
                               {TPDBInit,           841,  "dbInit",            0, false},
                               {TPDBChange,         842,  "dbChange",          0, false},
-                              {TPDBCreateTable,     -3,  "dbCreateTable",     0, false},
+                              {TPDBCreateTable,    843,  "dbCreateTable",     0, false},
                               {TPDBDropTable,       -4,  "dbDropTable",       0, false},
                               {TPDBSelectColumn,    -5,  "dbSelectColumn",    0, false},
@@ -305,4 +305,5 @@
 
     // Attempt to initialize database with invalid arguments
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid host");
     dbh = psDBInit("xxx",NULL,NULL,NULL);
     if(dbh != NULL) {
@@ -312,4 +313,5 @@
 
     // Attempt cleanup database/connection with NULL psDB object
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database objec");
     psDBCleanup(NULL);
 
@@ -336,4 +338,5 @@
 
     // Attemp to change database to invalid database name
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid database");
     if(psDBChange(dbh,"abc")) {
         psError(PS_ERR_UNKNOWN,true,"Did not expect return true for unknown database name");
@@ -345,4 +348,5 @@
 
     // Attempt to change database with NULL database object
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for null database object");
     if(psDBChange(NULL,dbname)) {
         psError(PS_ERR_UNKNOWN,true,"Did not expect return true for NULL database object");
@@ -353,28 +357,50 @@
 }
 
-// Testpoint #XXX, psDBCreateTable shall create tables in the test database ...
+// Testpoint #843, psDBCreateTable shall create tables in the test database ...
 psS32 TPDBCreateTable( void )
 {
-    psS32 failed = 0;
     psDB *dbh = NULL;
     const char* table = "table1";
+
+    // Create metadata for table definition
     psMetadata *md = _get_CreateTableMetadata();
 
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        return 1;
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "psDBCreateTable shall create a new table in the new test database.\n" );
-
-    failed = ! psDBCreateTable(dbh, table, md);
-    if (!failed) {
+    // Initialize database connection
+    dbh = _init_psDB();
+    if (dbh == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL for valid argument in database connection");
+        return 1;
+    }
+
+    // Attempt to create database table with valid arguments
+    if(!psDBCreateTable(dbh, table, md)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for valid arguments");
+        return 2;
+    } else {
+        // Drop the table from the test database
         psDBDropTable(dbh, table);
     }
 
+    // Free metadata definition of table
     psFree(md);
-    psDBCleanup(dbh);
-
-    return failed;
+
+    // Attempt to create table with NULL table definition
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL parameter");
+    if(psDBCreateTable(dbh,table,NULL)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL metadata object");
+        return 3;
+    }
+
+    // Attempt to create table with NULL connection
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL parameter");
+    if(psDBCreateTable(NULL, table, md)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL database object");
+        return 4;
+    }
+
+    // Close/cleanup database connection
+    psDBCleanup(dbh);
+
+    return 0;
 }
 
