Index: trunk/psLib/test/sysUtils/tst_psString.c
===================================================================
--- trunk/psLib/test/sysUtils/tst_psString.c	(revision 543)
+++ trunk/psLib/test/sysUtils/tst_psString.c	(revision 605)
@@ -11,4 +11,5 @@
  *    5) Copy string to larger string - psStringNCopy
  *    6) Copy string with negative size - psStringNCopy
+ *    7) Verifiy creation of string literal - PS_STRING
  * 
  *  Return:   Number of test points which failed
@@ -16,6 +17,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-04-28 22:00:02 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-05-07 22:06:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -32,5 +33,7 @@
     bool  tpResult = false;
     char  *stringval = "E R R O R";
-    char  *substringval = "E R R ";
+    char  *stringval1 = "e r r o r";
+    char  *stringvalnocopy = "F A I L";
+    char  *substringval = "e r r ";
     int   substringlen = 6;
     char  *emptyval = "";
@@ -41,4 +44,6 @@
     int   result = 0;
     int   result1 = 0;
+    int   memBlockAllocated = 0;
+    psMemBlock ***memBlockPtr = NULL;
 
     // Test point #1 Verify string copy - psStringCopy
@@ -49,4 +54,6 @@
     if ( result != 0 ) {
         fprintf(stderr, "Failed test point #1 strcmp result = %d expected 0\n",result);
+        fprintf(stderr, "                               src = %s expected %s\n",
+                strResult, stringval);
         tpResult = false;
         tpFails++;
@@ -54,4 +61,6 @@
         tpResult = true;
     }
+    // Free memory allocated
+    psFree(strResult);
     printFooter(stderr, "psStringCopy","Verify string copy", tpResult);
 
@@ -63,4 +72,6 @@
     if ( result != 0 ) {
         fprintf(stderr,"Failed test point #2 strcmp result = %d expected 0\n",result);
+        fprintf(stderr,"                               src = %s expected %s\n",
+                strResult, emptyval);
         tpResult = false;
         tpFails++;
@@ -68,17 +79,17 @@
         tpResult = true;
     }
+    // Free memory allocated
+    psFree(strResult);
     printFooter(stderr, "psStringCopy","Verify empty string copy", tpResult);
 
     // Test point #3 Verify string copy with length - psStringNCopy
     printPositiveTestHeader(stderr,"psStringNCopy","Verify string copy with length");
-    strResult = psStringNCopy(stringval, substringlen);
+    strResult = psStringNCopy(stringval1, substringlen);
     // Perform string compare and get string length
-    result = strcmp(strResult, substringval);
-    result1 = strlen(strResult);
-    if ( ( result != 0 ) ||
-            ( result1 != substringlen ) ) {
+    result = strncmp(strResult, substringval, substringlen);
+    if ( result != 0 )  {
         fprintf(stderr,"Failed test point #3 strcmp result = %d expected 0\n",result);
-        fprintf(stderr,"                     strlen result = %d expected %d\n",
-                result1, substringlen);
+        fprintf(stderr,"                               src = %s expected %s\n",
+                strResult, substringval);
         tpResult = false;
         tpFails++;
@@ -86,17 +97,18 @@
         tpResult = true;
     }
+    // Free memory allocated
+    psFree(strResult);
     printFooter(stderr, "psStringNCopy","Verify string copy with length", tpResult);
 
     // Test point #4 Verify empty string copy with length - psStringNCopy
     printPositiveTestHeader(stderr,"psStringNCopy", "Verify empty string copy with length");
-    strResult = psStringNCopy(stringval, 0);
+    strResult = psStringNCopy(stringvalnocopy, 0);
     // Perform string compare and get sting length
-    result = strcmp(strResult, emptyval);
+    result = strcmp(strResult, stringvalnocopy);
     result1 = strlen(strResult);
-    if ( ( result != 0 ) ||
-            ( result1 != strlen(emptyval) ) ) {
-        fprintf(stderr,"Failed test point #4 strcmp result = %d expected %d\n",result,0);
-        fprintf(stderr,"                     strlen result = %d expected %d\n",result1,
-                (int)strlen(emptyval));
+    if ( result == 0 ) {
+        fprintf(stderr,"Failed test point #4 strcmp result = %d didn't expected %d\n",result,0);
+        fprintf(stderr,"                               src = %s didn't expected %s\n",
+                strResult, stringvalnocopy);
         tpResult = false;
         tpFails++;
@@ -104,4 +116,6 @@
         tpResult = true;
     }
+    // Free memory
+    psFree(strResult);
     printFooter(stderr, "psStringNCopy","Verify empty string copy with length", tpResult);
 
@@ -116,4 +130,6 @@
             ( result1 != strlen(stringval) ) ) {
         fprintf(stderr,"Failed test point #5 strcmp result = %d expected %d\n",result,0);
+        fprintf(stderr,"                               src = %s expected %s\n",
+                strResult, stringval);
         fprintf(stderr,"                     strlne result = %d expected %d\n",result1,
                 (int)strlen(stringval));
@@ -123,4 +139,6 @@
         tpResult = true;
     }
+    // Free memory
+    psFree(strResult);
     printFooter(stderr, "psStringNCopy", "Copy string to larger string", tpResult);
 
@@ -136,5 +154,28 @@
         tpResult = true;
     }
+    // Memory should not have been allocated
     printFooter(stderr, "psStringNCopy", "Copy string with negative size", tpResult);
+
+    // Test point #7 Verify creation of string literal - PS_STRING
+    printPositiveTestHeader(stderr,"PS_STRING","Verify creation of string literal");
+    strResult = PS_STRING(E R R O R);
+    result = strcmp(strResult, stringval);
+    if ( result != 0 ) {
+        fprintf(stderr,"Failed test point #7 strcmp result = %d expected %d",result,0);
+        tpResult = false;
+        tpFails++;
+    } else {
+        tpResult = true;
+    }
+    // Memory should not have been allocated
+    printFooter(stderr, "PS_STRING", "Verify creation of string literal", tpResult);
+
+    // Check for memory leaks
+    memBlockAllocated = psMemCheckLeaks(0, memBlockPtr, stderr);
+    if ( memBlockAllocated != 0 ) {
+        fprintf(stderr,"Failed - Memory leaks detected - Blocks still allocated = %d\n",
+                memBlockAllocated);
+        tpFails++;
+    }
 
     // Display test driver fail message if tpFail not zero
