Changeset 2204 for trunk/psLib/test/psTest.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/psTest.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/psTest.c
r1810 r2204 28 28 #define HEADER_BOTTOM "\\**********************************************************************************/\n\n" 29 29 30 bool p_runTestSuite( FILE *fp, const char* testPointFile, const char* packageName,31 testDescription tests[], intargc, char * const argv[] )32 { 33 bool success = true;34 bool runAll = true;35 bool useFork = true;36 bool found;37 intc;38 intn;30 psBool p_runTestSuite( FILE *fp, const char* testPointFile, const char* packageName, 31 testDescription tests[], psS32 argc, char * const argv[] ) 32 { 33 psBool success = true; 34 psBool runAll = true; 35 psBool useFork = true; 36 psBool found; 37 psS32 c; 38 psS32 n; 39 39 extern char *optarg; 40 40 … … 62 62 printf( "Testpoints:\n" ); 63 63 runAll = false; 64 for ( intindex = 0; tests[ index ].fcn != NULL; index++ ) {64 for ( psS32 index = 0; tests[ index ].fcn != NULL; index++ ) { 65 65 printf( " %6d - %s \n", tests[ index ].testPointNumber, 66 66 tests[ index ].testPointName ); … … 70 70 case 't': 71 71 runAll = false; 72 for ( intindex = 0; tests[ index ].fcn != NULL; index++ ) {72 for ( psS32 index = 0; tests[ index ].fcn != NULL; index++ ) { 73 73 if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) { 74 74 success = p_runTest( fp, … … 90 90 } 91 91 found = false; 92 for ( intindex = 0; tests[ index ].fcn != NULL; index++ ) {92 for ( psS32 index = 0; tests[ index ].fcn != NULL; index++ ) { 93 93 if ( n == tests[ index ].testPointNumber ) { 94 94 found = true; … … 116 116 117 117 if ( runAll ) { 118 for ( intindex = 0; tests[ index ].fcn != NULL; index++ ) {118 for ( psS32 index = 0; tests[ index ].fcn != NULL; index++ ) { 119 119 if ( ! tests[ index ].isDuplicateEntry ) { 120 120 success = p_runTest( fp, … … 136 136 } 137 137 138 bool p_runTest( FILE *fp, const char* testPointFile, const char* packageName, const char* testPointName,139 testFcn fcn, int expectedReturn, bool useFork )140 { 141 intchildReturn = 0;138 psBool p_runTest( FILE *fp, const char* testPointFile, const char* packageName, const char* testPointName, 139 testFcn fcn, psS32 expectedReturn, psBool useFork ) 140 { 141 psS32 childReturn = 0; 142 142 pid_t child; 143 143 … … 147 147 child = fork(); 148 148 if ( child == 0 ) { // I am the child process, run the test 149 intcurrentId = psMemGetId();150 intretVal = fcn();149 psS32 currentId = psMemGetId(); 150 psS32 retVal = fcn(); 151 151 if ( retVal == 0 ) { // only bother checking memory if test executed to end. 152 152 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) { … … 171 171 } 172 172 } else { 173 intcurrentId = psMemGetId();173 psS32 currentId = psMemGetId(); 174 174 childReturn = fcn(); 175 175 if ( childReturn == 0 ) { // only bother checking memory if test executed to end. … … 215 215 const char* testPointName, 216 216 const char* expectedError, 217 intexitValue )217 psS32 exitValue ) 218 218 { 219 219 char TP[ 80 ]; … … 235 235 const char* packageName, 236 236 const char* testPointName, 237 bool success )237 psBool success ) 238 238 { 239 239 if ( success ) {
Note:
See TracChangeset
for help on using the changeset viewer.
