Changeset 1835
- Timestamp:
- Sep 20, 2004, 12:04:57 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psTrace.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psTrace.c
r1742 r1835 33 33 }; 34 34 35 testDescription tests2[] = { 36 {testTrace08, 8, "Testing ", 0, false}, 37 }; 38 35 39 int main( int argc, char* argv[] ) 36 40 { … … 102 106 static int testTrace02(void) 103 107 { 108 psTraceReset(); 104 109 psTraceSetDestination(stderr); 105 110 psTraceSetLevel(".A.B", 2); … … 108 113 psTraceSetLevel(".A.B", 10); 109 114 psTracePrintLevels(); 115 116 if (10 != psTraceGetLevel(".A.B.C")) { 117 fprintf(stderr,"ERROR: .A.B.C did not dynamically inherit a trace level (%d)\n", 118 psTraceGetLevel(".A.B.C")); 119 return 2; 120 } 121 122 if (10 != psTraceGetLevel(".A.B.C.D")) { 123 fprintf(stderr,"ERROR: .A.B.C.D did not dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D")); 124 return 2; 125 } 126 127 if (5 != psTraceGetLevel(".A.B.C.D.E")) { 128 fprintf(stderr,"ERROR: .A.B.C.D.E did dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D.E")); 129 return 2; 130 } 110 131 111 132 return 0; … … 289 310 } 290 311 312 // Ensure that the leading dot in the component names are optional. 291 313 static int testTrace08(void) 292 314 { 315 psTraceReset(); 293 316 (void)psTraceSetLevel(".", 9); 294 317 … … 306 329 (void)psTraceSetLevel(".c.b", 3); 307 330 (void)psTraceSetLevel(".c.c", 5); 331 332 psTracePrintLevels(); 308 333 309 334 if ((psTraceGetLevel(".")!=9) || … … 318 343 (psTraceGetLevel("c.b")!=3) || 319 344 (psTraceGetLevel("c.c")!=5)) { 345 printf("psTraceGetLevel(.) is %d\n", psTraceGetLevel(".")); 346 printf("psTraceGetLevel(a) is %d\n", psTraceGetLevel("a")); 347 printf("psTraceGetLevel(b) is %d\n", psTraceGetLevel("b")); 348 printf("psTraceGetLevel(c) is %d\n", psTraceGetLevel("c")); 349 printf("psTraceGetLevel(a.a) is %d\n", psTraceGetLevel("a.a")); 350 printf("psTraceGetLevel(a.b) is %d\n", psTraceGetLevel("a.b")); 351 printf("psTraceGetLevel(b.a) is %d\n", psTraceGetLevel("b.a")); 352 printf("psTraceGetLevel(b.b) is %d\n", psTraceGetLevel("b.b")); 353 printf("psTraceGetLevel(c.a) is %d\n", psTraceGetLevel("c.a")); 354 printf("psTraceGetLevel(c.b) is %d\n", psTraceGetLevel("c.b")); 355 printf("psTraceGetLevel(c.c) is %d\n", psTraceGetLevel("c.c")); 356 320 357 return 1; 321 358 } … … 323 360 return 0; 324 361 } 325
Note:
See TracChangeset
for help on using the changeset viewer.
