Changeset 17515 for trunk/psLib/test/sys/tap_psTrace.c
- Timestamp:
- May 4, 2008, 2:09:04 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tap_psTrace.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psTrace.c
r12781 r17515 19 19 plan_tests(54); 20 20 21 # define DEBUG 1 22 # if (DEBUG) 23 FILE *output = fopen ("/dev/null", "w"); 24 int outFD = fileno (output); 25 # else 26 int outFD = 2; 27 # endif 28 21 29 // testTrace00() 22 30 { 23 31 psMemId id = psMemGetId(); 24 32 psS32 lev = 0; 25 (void)psTraceSetDestination( 2);33 (void)psTraceSetDestination(outFD); 26 34 for (int i=0;i<10;i++) { 27 35 (void)psTraceSetLevel(".", i); … … 58 66 { 59 67 psMemId id = psMemGetId(); 60 (void)psTraceSetDestination( 2);68 (void)psTraceSetDestination(outFD); 61 69 (void)psTraceSetLevel(".A.B.C.D.E", 5); 62 70 psTrace(".A.C.D.C",1,"You should not see this"); … … 72 80 psMemId id = psMemGetId(); 73 81 psTraceReset(); 74 (void)psTraceSetDestination( 2);82 (void)psTraceSetDestination(outFD); 75 83 (void)psTraceSetLevel(".A.B", 2); 76 84 (void)psTraceSetLevel(".A.B.C.D.E", 5); … … 97 105 { 98 106 psMemId id = psMemGetId(); 99 (void)psTraceSetDestination( 2);107 (void)psTraceSetDestination(outFD); 100 108 101 109 for (int i=0;i<10;i++) { … … 134 142 for (int nb = 0 ; nb<4;nb++) { 135 143 if (nb == 0) 136 (void)psTraceSetDestination( 1);144 (void)psTraceSetDestination(((outFD == 2) ? 1 : outFD)); 137 145 if (nb == 1) 138 (void)psTraceSetDestination( 2);146 (void)psTraceSetDestination(((outFD == 2) ? 2 : outFD)); 139 147 if (nb == 2) 140 (void)psTraceSetDestination( 0);148 (void)psTraceSetDestination(((outFD == 2) ? 0 : outFD)); 141 149 if (nb == 3) 142 150 (void)psTraceSetDestination(FD); … … 174 182 { 175 183 psMemId id = psMemGetId(); 176 (void)psTraceSetDestination( 2);184 (void)psTraceSetDestination(outFD); 177 185 (void)psTraceSetLevel(".", 9); 178 186 (void)psTraceSetLevel(".a", 8); … … 213 221 { 214 222 psMemId id = psMemGetId(); 215 (void)psTraceSetDestination( 2);223 (void)psTraceSetDestination(outFD); 216 224 (void)psTraceSetLevel(".", 9); 217 225 (void)psTraceSetLevel(".a", 8); … … 287 295 ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks"); 288 296 } 297 298 # if (DEBUG) 299 close (outFD); 300 # endif 301 289 302 }
Note:
See TracChangeset
for help on using the changeset viewer.
