Changeset 847
- Timestamp:
- Jun 3, 2004, 4:07:28 PM (22 years ago)
- Location:
- trunk/psLib/test/sysUtils
- Files:
-
- 2 edited
-
tst_psHash01.c (modified) (1 diff)
-
tst_psLogMsg00.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psHash01.c
r584 r847 1 1 /***************************************************************************** 2 This code tests whether a hash tablebe de-allocated successfully.2 This code will test whether a hash table can be de-allocated successfully. 3 3 4 4 GUS: figure out how the memory leak detection stuff works, then put it -
trunk/psLib/test/sysUtils/tst_psLogMsg00.c
r584 r847 1 1 /***************************************************************************** 2 This code tests whether trace levels can be set successfully. 2 This code will test whether trace levels can be set successfully. 3 This code will test whether trace messages can be displayed with printf 4 style string. 3 5 *****************************************************************************/ 4 6 #include <stdio.h> 5 7 #include "pslib.h" 6 8 #include "psTest.h" 9 10 void myLogMsg(const char *name, 11 int level, 12 const char *fmt, 13 ...) 14 { 15 va_list ap; 16 17 // Test whether psVLogMsg() accept a va_list for output variables. 18 va_start(ap, fmt); 19 psVLogMsg(name, level, fmt, ap); 20 va_end(ap); 21 } 7 22 8 23 int main() … … 13 28 printPositiveTestHeader(stdout, 14 29 "psLogMsg functions", 15 "default log levels ");30 "default log levels, printf-style strings"); 16 31 17 32 // Send a log messages for levels 0:9. Only the first four messages … … 25 40 "default log levels", 26 41 testStatus); 42 43 44 // Test whether psVLogMsg() accept a va_list for output variables. 45 printPositiveTestHeader(stdout, 46 "psLogMsg functions", 47 "default log levels, psVLogMsg()"); 48 49 // Send a log messages for levels 0:9. Only the first four messages 50 // should actually be displayed. 51 for (i=0;i<10;i++) { 52 myLogMsg(__func__, i, "Hello World! My level is %d\n", i); 53 } 54 55 printFooter(stdout, 56 "psLogMsg functions", 57 "default log levels", 58 testStatus); 27 59 return(!testStatus); 60 61 28 62 } 63
Note:
See TracChangeset
for help on using the changeset viewer.
