Index: trunk/psLib/test/sys/tst_psString.c
===================================================================
--- trunk/psLib/test/sys/tst_psString.c	(revision 6211)
+++ trunk/psLib/test/sys/tst_psString.c	(revision 6218)
@@ -20,6 +20,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-01-26 23:31:22 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-01-27 01:49:05 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -442,7 +442,7 @@
 {
     psList *strList = NULL;
-    char str[30];
+    char str[35];
     char split[5];
-    strncpy(str, "This is, a, test case, to check.", 30);
+    strncpy(str, "This is, a, test case, to check.", 35);
     strncpy(split, ",", 2);
     psString psStr;
@@ -456,4 +456,5 @@
     if (strList != NULL) {
         psFree(strList);
+        return 1;
     }
     //Return NULL for NULL string input
@@ -462,4 +463,5 @@
     if (strList != NULL) {
         psFree(strList);
+        return 2;
     }
     //Return NULL for NULL splitter input
@@ -468,18 +470,151 @@
     if (strList != NULL) {
         psFree(strList);
-    }
-
-
-    /*
-        strList = psStringSplit(str, split);
-     
-        strList = psStringSplit(psStr, split);
-     
-        strList = psStringSplit(str, psSplit);
-     
-        strList = psStringSplit(psStr, psSplit);
-    */
-    //    psFree(strList);
-    return 0;
-}
-
+        return 3;
+    }
+    //Return a psList* of psStrings
+    strList = psStringSplit(str, split);
+    if (strList->n != 4) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return the correct number of strings.\n");
+        return 4;
+    }
+    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 5;
+    }
+    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 6;
+    }
+    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 7;
+    }
+    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 8;
+    }
+    psFree(strList);
+    //Return correct psList when using (psString, char*)
+    strList = psStringSplit(psStr, split);
+    if (strList->n != 4) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return the correct number of strings.\n");
+        return 9;
+    }
+    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 10;
+    }
+    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 11;
+    }
+    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 12;
+    }
+    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 13;
+    }
+    psFree(strList);
+    //Return correct psList when using (char*, psString)
+    strList = psStringSplit(str, psSplit);
+    if (strList->n != 4) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return the correct number of strings.\n");
+        return 14;
+    }
+    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 15;
+    }
+    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 16;
+    }
+    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 17;
+    }
+    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 18;
+    }
+    psFree(strList);
+    //Return correct psList when using (psString, psString)
+    strList = psStringSplit(psStr, psSplit);
+    if (strList->n != 4) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return the correct number of strings.\n");
+        return 19;
+    }
+    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 20;
+    }
+    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 21;
+    }
+    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 22;
+    }
+    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 23;
+    }
+    psFree(strList);
+    //Return correct psList output for string of zero length case
+    strncpy(str, "This is,, a,, test case,, to check.", 35);
+    strList = psStringSplit(str, split);
+    if (strList->n != 4) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return the correct number of strings.\n");
+        return 24;
+    }
+    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 25;
+    }
+    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 26;
+    }
+    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 27;
+    }
+    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psStringSplit failed to return expected strings.");
+        return 28;
+    }
+
+    psFree(strList);
+    psFree(psStr);
+    psFree(psSplit);
+    return 0;
+}
+
