Index: trunk/psLib/test/sys/tap_psStringSubstitute.c
===================================================================
--- trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 10446)
+++ trunk/psLib/test/sys/tap_psStringSubstitute.c	(revision 12781)
@@ -11,73 +11,87 @@
 int main (void)
 {
+    psLogSetFormat("HLNM");
+    psLogSetLevel(PS_LOG_INFO);
     plan_tests(16);
 
-    diag("psStringSubstitute() tests");
 
     // Return input for NULL key
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, ",", NULL);
         ok(input && strcmp(input, ORIGINAL) == 0, "output = %s", input);
         psFree(input);
-        //        ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks");
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Return input for empty key
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, "XXX", "");
         ok(input && strcmp(input, ORIGINAL) == 0, "output = %s", input);
         psFree(input);
-        //        ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks");
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Return corrected version for NULL replace
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, NULL, ",");
         ok(input && strcmp(input, CORRECTED) == 0, "output = %s", input);
         psFree(input);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Return corrected version for empty replace
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, "", ",");
         ok(input && strcmp(input, CORRECTED) == 0, "output = %s", input);
         psFree(input);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Return NULL for NULL input
     {
+        psMemId id = psMemGetId();
         int status = psStringSubstitute(NULL, "XXX", ",");
         ok(status == 0, "status = %d", status);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Return emptry string for empty input
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy("");
         psStringSubstitute(&input, "XXX", ",");
         ok(input && strcmp(input, "") == 0, "output = %s", input);
         psFree(input);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Change commas to bangs
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, "!", ",");
         ok(input && strcmp(input, "This is! a! test case! to check.") == 0, "output = %s", input);
         psFree(input);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
 
     // Long replacement text --- should allocate new space
     {
+        psMemId id = psMemGetId();
         psString input = psStringCopy(ORIGINAL);
         psStringSubstitute(&input, "; This string is too long to fit in input(35 chars)", ".");
@@ -86,8 +100,5 @@
            "output = %s", input);
         psFree(input);
-        mem();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
-
-
-    return exit_status();
 }
