Changeset 1732 for trunk/psLib/test/sysUtils/tst_psTrace.c
- Timestamp:
- Sep 8, 2004, 12:09:07 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psTrace.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psTrace.c
r1698 r1732 41 41 int lev = 0; 42 42 43 psTraceSetDestination(stderr); 44 43 45 for (i=0;i<10;i++) { 44 46 (void)psTraceSetLevel(".", i); 45 47 lev = psTraceGetLevel("."); 46 48 if (lev != i) { 47 printf("ERROR: (.) expected trace level was %d, actual was %d\n",48 i, lev);49 fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n", 50 i, lev); 49 51 return 1; 50 52 } … … 56 58 lev = psTraceGetLevel(".NODE00"); 57 59 if (lev != i) { 58 printf("ERROR: (.NODE00) expected trace level was %d, actual was %d\n",59 i, lev);60 fprintf(stderr,"ERROR: (.NODE00) expected trace level was %d, actual was %d\n", 61 i, lev); 60 62 return 2; 61 63 } … … 63 65 lev = psTraceGetLevel("."); 64 66 if (lev != 3) { 65 printf("ERROR: (.) expected trace level was %d, actual was %d\n",66 i, 3);67 fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n", 68 i, 3); 67 69 return 3; 68 70 } … … 75 77 lev = psTraceGetLevel(".NODE00.NODE01"); 76 78 if (lev != i) { 77 printf("ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",78 i, lev);79 fprintf(stderr,"ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n", 80 i, lev); 79 81 return 4; 80 82 } … … 86 88 static int testTrace01(void) 87 89 { 90 psTraceSetDestination(stderr); 88 91 (void)psTraceSetLevel(".A.B.C.D.E", 5); 89 92 … … 95 98 static int testTrace02(void) 96 99 { 100 psTraceSetDestination(stderr); 97 101 psTraceSetLevel(".A.B", 2); 98 102 psTraceSetLevel(".A.B.C.D.E", 5); … … 108 112 int i = 0; 109 113 int lev = 0; 114 115 psTraceSetDestination(stderr); 110 116 111 117 for (i=0;i<10;i++) { … … 115 121 lev = psTraceGetLevel("."); 116 122 if (lev != PS_UNKNOWN_TRACE_LEVEL) { 117 printf("ERROR: expected trace level was %d, actual was %d\n",118 PS_UNKNOWN_TRACE_LEVEL, lev);123 fprintf(stderr,"ERROR: expected trace level was %d, actual was %d\n", 124 PS_UNKNOWN_TRACE_LEVEL, lev); 119 125 return 1; 120 126 } … … 128 134 (3 != psTraceGetLevel(".a.b")) || 129 135 (2 != psTraceGetLevel(".a.b.c"))) { 130 printf("ERROR: trace successFlag = false;levels were not settable?\n");136 fprintf(stderr,"ERROR: trace successFlag = false;levels were not settable?\n"); 131 137 return 2; 132 138 } … … 137 143 (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b")) || 138 144 (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b.c"))) { 139 printf("ERROR: trace levels were not reset properly\n");145 fprintf(stderr,"ERROR: trace levels were not reset properly\n"); 140 146 return 3; 141 147 } … … 161 167 psTraceSetDestination(fp); 162 168 163 printPositiveTestHeader(stdout,164 "psTrace functions",165 "psTrace()");166 167 169 (void)psTraceSetLevel(".", 4); 168 170 psTrace(".", 5, "(0) This message should not be displayed (%x)\n", … … 196 198 static int testTrace05(void) 197 199 { 200 psTraceSetDestination(stderr); 201 198 202 (void)psTraceSetLevel(".", 9); 199 203 … … 220 224 static int testTrace06(void) 221 225 { 226 psTraceSetDestination(stderr); 227 222 228 (void)psTraceSetLevel(".", 9); 223 229
Note:
See TracChangeset
for help on using the changeset viewer.
