Index: trunk/psLib/test/sysUtils/tst_psString.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psString.c	(revision 3994)
+++ trunk/psLib/test/sysUtils/tst_psString.c	(revision 3996)
@@ -1,3 +1,6 @@
 /** @file  tst_psString.c
+ *
+ * -*- mode: C; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*-
+ * vim: set cindent ts=8 sw=4 expandtab:
  *
  *  @brief Test driver for psString functions
@@ -17,6 +20,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-05-20 00:44:55 $
+ *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-05-20 01:40:40 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +30,6 @@
 #include "pslib_strict.h"
 #include "psTest.h"
+
+#define STR_0 "binky had a leeeetle lamb"
 
 static psS32 testStringCopy00(void);
@@ -35,4 +40,14 @@
 static psS32 testStringCopy05(void);
 static psS32 testStringCopy06(void);
+
+static psS32 testStrAppend00(void);
+static psS32 testStrAppend01(void);
+static psS32 testStrAppend02(void);
+static psS32 testStrAppend03(void);
+
+static psS32 testStrPrepend00(void);
+static psS32 testStrPrepend01(void);
+static psS32 testStrPrepend02(void);
+static psS32 testStrPrepend03(void);
 
 testDescription tests[] = {
@@ -44,4 +59,14 @@
                               {testStringCopy05, 5, "Copy string with negative size", 0, false},
                               {testStringCopy06, 6, "Verify creation of string literal", 0, false},
+
+                              {testStrAppend00,  7, "Verify generic string append", 0, false},
+                              {testStrAppend01,  8, "Test append NULL handling", 0, false},
+                              {testStrAppend02,  9, "Verify append string creation", 0, false},
+                              {testStrAppend03, 10, "Test append null-op", 0, false},
+
+                              {testStrPrepend00,11, "Verify generic string prepend", 0, false},
+                              {testStrPrepend01,12, "Test prepend NULL handling", 0, false},
+                              {testStrPrepend02,13, "Verify prepend string creation", 0, false},
+                              {testStrPrepend03,14, "Test prepend null-op", 0, false},
                               {NULL}
                           };
@@ -249,2 +274,160 @@
     return 0;
 }
+
+static psS32 testStrAppend00(void)
+{
+    char *str=NULL;
+    int result = 0;
+
+    str = psStringCopy("3.14159");
+
+    psStringAppend(&str, "%d%s", 2653589, "79323846");
+
+    // Test point: Verify string append
+    result = strcmp(str, "3.14159265358979323846");
+    if ( result != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
+
+static psS32 testStrAppend01(void)
+{
+    ssize_t sz;
+    char *str=NULL;
+
+    // test nonsensical invocations ...
+    sz = psStringAppend(NULL, NULL);
+    if ( sz != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+    sz = psStringAppend(&str, NULL);
+    if ( sz != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    return 0;
+}
+
+static psS32 testStrAppend02(void)
+{
+    char *str=NULL;
+    int result;
+
+    // test string creation
+    psStringAppend(&str, "%s", "fubar");
+    result = strcmp(str, "fubar");
+    if ( result != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
+
+static psS32 testStrAppend03(void)
+{
+    char *str=NULL;
+    int result;
+
+    str = psStringCopy(STR_0);
+
+    // test null-op
+    psStringAppend(&str, "");
+    result = strcmp(str, STR_0);
+    if ( result != 0 ) {
+        fprintf(stderr,"Failed test point str=[%s]\n", str);
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
+
+static psS32 testStrPrepend00(void)
+{
+    char *str=NULL;
+    int result = 0;
+
+    str = psStringCopy("79323846");
+
+    psStringPrepend(&str, "%s%d","3.14159", 2653589 );
+
+    // Test point: Verify string append
+    result = strcmp(str, "3.14159265358979323846");
+    if ( result != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
+
+static psS32 testStrPrepend01(void)
+{
+    ssize_t sz;
+    char *str=NULL;
+
+    // test nonsensical invocations ...
+    sz = psStringPrepend(NULL, NULL);
+    if ( sz != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+    sz = psStringPrepend(&str, NULL);
+    if ( sz != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    return 0;
+}
+
+static psS32 testStrPrepend02(void)
+{
+    char *str=NULL;
+    int result;
+
+    // test string creation
+    psStringPrepend(&str, "%s", "fubar");
+    result = strcmp(str, "fubar");
+    if ( result != 0 ) {
+        fprintf(stderr,"%s","Failed test point\n");
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
+
+static psS32 testStrPrepend03(void)
+{
+    char *str=NULL;
+    int result;
+
+    str = psStringCopy(STR_0);
+
+    // test null-op
+    psStringPrepend(&str, "");
+    result = strcmp(str, STR_0);
+    if ( result != 0 ) {
+        fprintf(stderr,"Failed test point str=[%s]\n", str);
+        return 1;
+    }
+
+    psFree(str);
+
+    return 0;
+}
