Index: trunk/psLib/test/sys/tap_psTrace.c
===================================================================
--- trunk/psLib/test/sys/tap_psTrace.c	(revision 12781)
+++ trunk/psLib/test/sys/tap_psTrace.c	(revision 17515)
@@ -19,9 +19,17 @@
     plan_tests(54);
 
+# define DEBUG 1
+# if (DEBUG)
+    FILE *output = fopen ("/dev/null", "w");
+    int outFD = fileno (output);
+# else
+    int outFD = 2;
+# endif
+
     // testTrace00()
     {
         psMemId id = psMemGetId();
         psS32 lev = 0;
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
         for (int i=0;i<10;i++) {
             (void)psTraceSetLevel(".", i);
@@ -58,5 +66,5 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
         (void)psTraceSetLevel(".A.B.C.D.E", 5);
         psTrace(".A.C.D.C",1,"You should not see this");
@@ -72,5 +80,5 @@
         psMemId id = psMemGetId();
         psTraceReset();
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
         (void)psTraceSetLevel(".A.B", 2);
         (void)psTraceSetLevel(".A.B.C.D.E", 5);
@@ -97,5 +105,5 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
 
         for (int i=0;i<10;i++) {
@@ -134,9 +142,9 @@
         for (int nb = 0 ; nb<4;nb++) {
             if (nb == 0)
-                (void)psTraceSetDestination(1);
+                (void)psTraceSetDestination(((outFD == 2) ? 1 : outFD));
             if (nb == 1)
-                (void)psTraceSetDestination(2);
+                (void)psTraceSetDestination(((outFD == 2) ? 2 : outFD));
             if (nb == 2)
-                (void)psTraceSetDestination(0);
+                (void)psTraceSetDestination(((outFD == 2) ? 0 : outFD));
             if (nb == 3)
                 (void)psTraceSetDestination(FD);
@@ -174,5 +182,5 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
         (void)psTraceSetLevel(".", 9);
         (void)psTraceSetLevel(".a", 8);
@@ -213,5 +221,5 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(2);
+        (void)psTraceSetDestination(outFD);
         (void)psTraceSetLevel(".", 9);
         (void)psTraceSetLevel(".a", 8);
@@ -287,3 +295,8 @@
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
+# if (DEBUG)
+    close (outFD);
+# endif
+
 }
