Index: trunk/psLib/test/dataIO/tst_psDB.c
===================================================================
--- trunk/psLib/test/dataIO/tst_psDB.c	(revision 4295)
+++ trunk/psLib/test/dataIO/tst_psDB.c	(revision 4296)
@@ -9,6 +9,6 @@
  *  @author Aaron Culliney, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-17 02:56:26 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-17 21:32:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -61,4 +61,5 @@
     const char *key5, const char *comm5, psS32  val5);
 static psMetadata *_get_row( void );
+static psMetadata *_get_invalid_row( void );
 static psMetadata *_get_where( void );
 static psMetadata *_get_update_values(const char *val0, psS32 val1, psF32 val2, psF64 val3, psBool val4);
@@ -232,4 +233,15 @@
 }
 
+psMetadata *_get_invalid_row( void )
+{
+    return _get_RowMetadata(
+               "key_string", "comment-string", STR_1,
+               "key_s32",    "comment-s32",    S32_1,
+               "key_999",    "comment-f32",    F32_1,
+               "key_f64",    "comment-f64",    F64_1,
+               "key_bool",   "comment-bool",   B_1,
+               NULL,         NULL,             0.0);
+}
+
 psMetadata *_get_where( void )
 {
@@ -979,31 +991,81 @@
 }
 
-// Testpoint #XXX, TPDBInsertOneRow shall write a row of data into a test table ...
+// Testpoint #848, TPDBInsertOneRow shall write a row of data into a test table ...
 psS32 TPDBInsertOneRow( void )
 {
-    psS32 failed = 0;
     psDB *dbh = NULL;
     const char* table = "table6";
+    psMetadata *invalidRow = NULL;
+
+    // Create table definition metadata
     psMetadata *row=NULL, *md = _get_CreateTableMetadata();
 
+    // Initialize database connection
     dbh = _init_psDB();
     if (dbh == NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for database initialization");
         return 1;
     }
 
-    psLogMsg( __func__, PS_LOG_INFO, "psDBInsertOneRow shall insert a row into a test table.\n" );
-
-    failed = ! psDBCreateTable(dbh, table, md);
-    if (!failed) {
-        row = _get_const_row1();
-        failed = ! psDBInsertOneRow(dbh, table, row);
-        psFree(row);
-        psDBDropTable(dbh, table);
-    }
-
+    // Create database table
+    if(!psDBCreateTable(dbh, table, md)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for create database");
+        psDBCleanup(dbh);
+        return 2;
+    }
+
+    // Insert a single row with valid arguments
+    row = _get_const_row1();
+    if(!psDBInsertOneRow(dbh, table, row)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for inserting row w/ valid arguments");
+        psDBDropTable(dbh,table);
+        psDBCleanup(dbh);
+        return 3;
+    }
+
+    // Insert a single row with NULL database
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database");
+    if(psDBInsertOneRow(NULL,table,row)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for NULL database");
+        psDBDropTable(dbh,table);
+        psDBCleanup(dbh);
+        return 4;
+    }
+
+    // Insert a single row which has column which does not match table
+    invalidRow = _get_invalid_row();
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid column item");
+    if(psDBInsertOneRow(dbh,table,invalidRow)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for invalid column item");
+        psDBDropTable(dbh,table);
+        psDBCleanup(dbh);
+        return 6;
+    }
+
+    // Insert a single row with invalid table
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid table");
+    if(psDBInsertOneRow(dbh,"table999",row)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for invalid table");
+        psDBDropTable(dbh,table);
+        psDBCleanup(dbh);
+        return 5;
+    }
+
+    // Insert a single row with NULL row
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL row");
+    if(psDBInsertOneRow(dbh,table,NULL)) {
+        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for NULL row");
+        psDBDropTable(dbh,table);
+        psDBCleanup(dbh);
+        return 6;
+    }
+
+    psFree(row);
+    psFree(invalidRow);
+    psDBDropTable(dbh, table);
     psFree(md);
     psDBCleanup(dbh);
 
-    return failed;
+    return 0;
 }
 
