Index: /trunk/psLib/test/sys/.cvsignore
===================================================================
--- /trunk/psLib/test/sys/.cvsignore	(revision 7879)
+++ /trunk/psLib/test/sys/.cvsignore	(revision 7880)
@@ -17,2 +17,3 @@
 core
 core.*
+tap_psStringSubstitute
Index: /trunk/psLib/test/sys/Makefile.am
===================================================================
--- /trunk/psLib/test/sys/Makefile.am	(revision 7879)
+++ /trunk/psLib/test/sys/Makefile.am	(revision 7880)
@@ -11,5 +11,6 @@
 	tst_psMemory \
 	tst_psString \
-	tst_psTrace
+	tst_psTrace \
+	tap_psStringSubstitute
 
 tst_psAbort_SOURCES =  tst_psAbort.c
@@ -20,4 +21,7 @@
 tst_psString_SOURCES =  tst_psString.c
 tst_psTrace_SOURCES =  tst_psTrace.c
+
+tap_psStringSubstitute_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src
+tap_psStringSubstitute_LDFLAGS 	= $(AM_LDFLAGS) $(top_builddir)/test/tap/src/libtap.la
 
 check_DATA =
Index: /trunk/psLib/test/sys/tap_psStringSubstitute.c
===================================================================
--- /trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 7880)
+++ /trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 7880)
@@ -0,0 +1,80 @@
+#include <stdio.h>
+#include <pslib.h>
+#include "tap.h"
+
+#define ORIGINAL "This is, a, test case, to check."
+#define CORRECTED "This is a test case to check."
+
+int main (void)
+{
+    plan_tests(8);
+
+    diag("psVectorAlloc() tests");
+
+    // Return input for NULL key
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, ",", NULL);
+        ok(output && strcmp(output, ORIGINAL) == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Return input for empty key
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, "XXX", "");
+        ok(output && strcmp(output, ORIGINAL) == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Return corrected version for NULL replace
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, NULL, ",");
+        ok(output && strcmp(output, CORRECTED) == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Return corrected version for empty replace
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, "", ",");
+        ok(output && strcmp(output, CORRECTED) == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Return NULL for NULL input
+    {
+        psString output = psStringSubstitute(NULL, "XXX", ",");
+        ok(!output, "output = %s", output);
+    }
+
+    // Return emptry string for empty input
+    {
+        psString input = psStringCopy("");
+        psString output = psStringSubstitute(input, "XXX", ",");
+        ok(output && strcmp(output, input) == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Change commas to bangs
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, "!", ",");
+        ok(output && strcmp(output, "This is! a! test case! to check.") == 0, "output = %s", output);
+        psFree(output);
+    }
+
+    // Long replacement text --- should allocate new space
+    {
+        psString input = psStringCopy(ORIGINAL);
+        psString output = psStringSubstitute(input, "; This string is too long to fit in input(35 chars)", ".");
+        ok(output && strcmp(output, "This is, a, test case, to check; "
+                            "This string is too long to fit in input(35 chars)") == 0,
+           "output = %s", output);
+        psFree(output);
+    }
+
+
+    return exit_status();
+}
Index: /trunk/psLib/test/sys/tst_psString.c
===================================================================
--- /trunk/psLib/test/sys/tst_psString.c	(revision 7879)
+++ /trunk/psLib/test/sys/tst_psString.c	(revision 7880)
@@ -20,6 +20,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-07-06 22:26:13 $
+ *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-07-12 21:25:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -53,5 +53,4 @@
 static psS32 testStrSplit00(void);
 static psS32 testNULLStrings(void);
-static psS32 testStrSub(void);
 
 testDescription tests[] = {
@@ -75,5 +74,4 @@
                               {testStrSplit00,15, "Test String Splitting", 0, false},
                               {testNULLStrings,666, "Test NULL String Error Handling", 0, false},
-                              {testStrSub,16, "Test String Substitute", 0, false},
                               {NULL}
                           };
@@ -711,83 +709,2 @@
     return 0;
 }
-
-static psS32 testStrSub(void)
-{
-    psString input = NULL;
-    char str[35];
-    strncpy(str, "This is, a, test case, to check.", 35);
-
-    //Return str for NULL key
-    input = psStringSubstitute(str, ",", NULL);
-    if (input != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psStringSubstitute failed to return unchanged str for NULL key.\n");
-        psFree(input);
-        return 1;
-    }
-    //Return NULL for empty key
-    input = psStringSubstitute(str, ",", "");
-    if (input != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psStringSubstitute failed to return unchanged str for empty key.\n");
-        psFree(input);
-        return 2;
-    }
-    //Return NULL for NULL replace
-    input = psStringSubstitute(str, NULL, ",");
-    if (input != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psStringSubstitute failed to return unchanged str for NULL replace.\n");
-        psFree(input);
-        return 3;
-    }
-    //Return NULL for NULL input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    input = psStringSubstitute(NULL, "", ",");
-    if (input != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psStringSubstitute failed to return NULL for NULL input.\n");
-        psFree(input);
-        return 4;
-    }
-    //Return empty string for empty input string
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    input = psStringSubstitute("", "", ",");
-    if (input != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psStringSubstitute failed to return empty string for empty input string.\n");
-        psFree(input);
-        return 5;
-    }
-    //Check valid test case, changing commas to exclamation points
-    input = psStringSubstitute(str, "!", ",");
-    if (strcmp(input, "This is! a! test case! to check.") != 0 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psStringSubstitute failed to return the correct output string.\n");
-        psFree(input);
-        return 7;
-    }
-    psFree(input);
-    input = NULL;
-    //Check valid test case, remove exclamation points
-    input = psStringSubstitute(str, "", ",");
-    if (strcmp(input, "This is a test case to check.") != 0 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psStringSubstitute failed to return the correct output string.\n");
-        psFree(input);
-        return 8;
-    }
-    psFree(input);
-    input = NULL;
-    //Check case where replacement is long.  Should still work now.
-    input = psStringSubstitute(str, "; This string is too long to fit in str(35 chars)", ".");
-    if (strcmp(input,"This is, a, test case, to check; This string is too long to fit in str(35 chars)") != 0 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psStringSubstitute failed to return the correct output string.\n");
-        psFree(input);
-        return 9;
-    }
-    psFree(input);
-
-    return 0;
-}
Index: /trunk/psLib/test/sys/verified/tst_psString.stderr
===================================================================
--- /trunk/psLib/test/sys/verified/tst_psString.stderr	(revision 7879)
+++ /trunk/psLib/test/sys/verified/tst_psString.stderr	(revision 7880)
@@ -175,19 +175,2 @@
 ---> TESTPOINT PASSED (psString{Test NULL String Error Handling} | tst_psString.c)
 
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psString.c                                             *
-*            TestPoint: psString{Test String Substitute}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testStrSub
-    Following should generate error message
-<DATE><TIME>|<HOST>|E|psStringSubstitute (FILE:LINENO)
-    Invalid string in psStringSubstitute.  Input cannot be NULL or empty.
-<DATE><TIME>|<HOST>|I|testStrSub
-    Following should generate error message
-<DATE><TIME>|<HOST>|E|psStringSubstitute (FILE:LINENO)
-    Invalid string in psStringSubstitute.  Input cannot be NULL or empty.
-
----> TESTPOINT PASSED (psString{Test String Substitute} | tst_psString.c)
-
