Changeset 2273 for trunk/psLib/test/sysUtils/tst_psError.c
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psError.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psError.c
r2204 r2273 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-1 0-27 00:57:33$15 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-11-04 01:05:00 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 100 100 // Generate three error messages to have messages on error stack 101 if (psError Msg("test4A",code, true, "Error code = %d", code) != code) {101 if (psError(code, true, "Error code = %d", code) != code) { 102 102 psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify."); 103 103 return 31; 104 104 } 105 if (psError Msg("test4A",(code+1), false, "Error code = %d", (code+1)) != (code+1)) {105 if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) { 106 106 psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify."); 107 107 return 32; 108 108 } 109 if (psError Msg("test4A",(code+2), false, "Error code = %d", (code+2)) != (code+2)) {109 if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) { 110 110 psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify."); 111 111 return 33; … … 165 165 166 166 // Generate three error messages 167 if (psError Msg("test3A",code, true, "Error code = %d", code) != code) {167 if (psError(code, true, "Error code = %d", code) != code) { 168 168 psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify."); 169 169 return 23; 170 170 } 171 if (psError Msg("test3A",(code+1), false, "Error code = %d", (code+1)) != (code+1)) {171 if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) { 172 172 psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify."); 173 173 return 24; 174 174 } 175 if (psError Msg("test3A",(code+2), false, "Error code = %d", (code+2)) != (code+2)) {175 if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) { 176 176 psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify."); 177 177 return 25; … … 219 219 220 220 // Generate error message and verify return value 221 if (psError Msg("test2A",code, true, "Error code = %d", code) != code ) {221 if (psError(code, true, "Error code = %d", code) != code ) { 222 222 psLogMsg("tst_psError02", PS_LOG_ERROR, "Failed return value verify."); 223 223 return 10; … … 233 233 234 234 // Verify the return value of psErrorMsg is the psErrorCode passed 235 if ( psError Msg("test1A",code, true, "Error code = %d", code) != code) {235 if ( psError(code, true, "Error code = %d", code) != code) { 236 236 psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return value verify."); 237 237 return 1; … … 240 240 241 241 // test1B empty string in for name argument 242 if ( psError Msg("",code+1, true, "Error code = %d", code+1) != code+1) {242 if ( psError(code+1, true, "Error code = %d", code+1) != code+1) { 243 243 psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return with empty string."); 244 244 return 2; … … 246 246 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1B"); 247 247 248 // test1C null pointer in for name argument249 if ( psErrorMsg(NULL, code+2, true, "Error code = %d", code+2) != code+2) {250 psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return with null name arg.");251 return 3;252 }253 psErrorStackPrint(stderr,"ERROR STACK PRINT Test1C");254 255 248 // test1D undefined code 256 if ( psError Msg("test1D",-1, true, "Error code = %d", -1) != -1) {249 if ( psError(-1, true, "Error code = %d", -1) != -1) { 257 250 psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with undefined code."); 258 251 return 4; … … 261 254 262 255 // test1E set psErrorMsg argument to false 263 if( psError Msg("test1E",code, false, "Error code = %d", code) != code) {256 if( psError(code, false, "Error code = %d", code) != code) { 264 257 psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with false new arg."); 265 258 return 5; … … 268 261 269 262 // test1F psErrorMsg with a error code less then PS_ERR_BASE(256) 270 if( psError Msg("test1F",9, true, "Errno code = %d", 9) != 9) {263 if( psError(9, true, "Errno code = %d", 9) != 9) { 271 264 psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with errno code."); 272 265 return 6; … … 287 280 288 281 // Test point #1 Multiple type values placed in the error string 289 psError( __func__,282 psError(PS_ERR_UNKNOWN, true, 290 283 "ALL TYPES intval = %d longval = %ld floatval = %f charval = %c strval = %s", 291 284 intval,longval,floatval,charval,stringval); 292 285 293 286 // Test point #2 String values in error message 294 psError(PS_ STRING(__LINE__),"NO VALUES");287 psError(PS_ERR_UNKNOWN, true, "NO VALUES"); 295 288 296 289 // Test point #3 Empty strings in error message 297 psError( "","");290 psError(PS_ERR_UNKNOWN, true, ""); 298 291 299 292 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
