Changeset 4944 for trunk/psLib/test/sys/tst_psTrace.c
- Timestamp:
- Sep 2, 2005, 11:32:06 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tst_psTrace.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tst_psTrace.c
r4547 r4944 8 8 #include "pslib_strict.h" 9 9 #include "psTest.h" 10 #include <fcntl.h> 11 #include <unistd.h> 10 12 11 13 … … 49 51 psS32 lev = 0; 50 52 51 psTraceSetDestination(stderr); 53 // psTraceSetDestination(stderr); 54 psTraceSetDestination(2); 52 55 53 56 for (i=0;i<10;i++) { … … 96 99 static psS32 testTrace01(void) 97 100 { 98 psTraceSetDestination(stderr); 101 // psTraceSetDestination(stderr); 102 psTraceSetDestination(2); 99 103 (void)psTraceSetLevel(".A.B.C.D.E", 5); 100 104 … … 111 115 { 112 116 psTraceReset(); 113 psTraceSetDestination(stderr); 117 // psTraceSetDestination(stderr); 118 psTraceSetDestination(2); 114 119 psTraceSetLevel(".A.B", 2); 115 120 psTraceSetLevel(".A.B.C.D.E", 5); … … 142 147 psS32 lev = 0; 143 148 144 psTraceSetDestination(stderr); 149 // psTraceSetDestination(stderr); 150 psTraceSetDestination(2); 145 151 146 152 for (i=0;i<10;i++) { … … 183 189 { 184 190 FILE *fp; 191 int FD; 185 192 psS32 nb = 0; 186 187 fp = fopen("tst_psTrace02_OUT", "w"); 193 FD = creat("tst_psTrace02_OUT", 0666); 194 // printf("\nFD = %d\n", FD); 195 // fp = fopen("tst_psTrace02_OUT", "w"); 196 fp = fdopen(FD, "w"); 188 197 for (nb = 0 ; nb<4;nb++) { 189 198 if (nb == 0) 190 psTraceSetDestination(stdout); 199 // psTraceSetDestination(stdout); 200 psTraceSetDestination(1); 191 201 if (nb == 1) 192 psTraceSetDestination(stderr); 202 // psTraceSetDestination(stderr); 203 psTraceSetDestination(2); 193 204 if (nb == 2) 194 psTraceSetDestination( NULL);205 psTraceSetDestination(-1); //NULL 195 206 if (nb == 3) 196 psTraceSetDestination( fp);207 psTraceSetDestination(FD); 197 208 198 209 (void)psTraceSetLevel(".", 4); … … 221 232 222 233 fclose(fp); 234 close(FD); 223 235 224 236 return(0); … … 227 239 static psS32 testTrace05(void) 228 240 { 229 psTraceSetDestination(stderr); 241 // psTraceSetDestination(stderr); 242 psTraceSetDestination(2); 230 243 231 244 (void)psTraceSetLevel(".", 9); … … 277 290 static psS32 testTrace06(void) 278 291 { 279 psTraceSetDestination(stderr); 292 // psTraceSetDestination(stderr); 293 psTraceSetDestination(2); 280 294 281 295 (void)psTraceSetLevel(".", 9);
Note:
See TracChangeset
for help on using the changeset viewer.
