IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psError.c

    r2204 r2273  
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-10-27 00:57:33 $
     15 *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-11-04 01:05:00 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999
    100100    // Generate three error messages to have messages on error stack
    101     if (psErrorMsg("test4A", code, true, "Error code = %d", code) !=  code) {
     101    if (psError(code, true, "Error code = %d", code) !=  code) {
    102102        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    103103        return 31;
    104104    }
    105     if (psErrorMsg("test4A", (code+1), false, "Error code = %d", (code+1)) != (code+1)) {
     105    if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) {
    106106        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    107107        return 32;
    108108    }
    109     if (psErrorMsg("test4A", (code+2), false, "Error code = %d", (code+2)) != (code+2)) {
     109    if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) {
    110110        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    111111        return 33;
     
    165165
    166166    // Generate three error messages
    167     if (psErrorMsg("test3A", code, true, "Error code = %d", code) !=  code) {
     167    if (psError(code, true, "Error code = %d", code) !=  code) {
    168168        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
    169169        return 23;
    170170    }
    171     if (psErrorMsg("test3A", (code+1), false, "Error code = %d", (code+1)) != (code+1)) {
     171    if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) {
    172172        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
    173173        return 24;
    174174    }
    175     if (psErrorMsg("test3A", (code+2), false, "Error code = %d", (code+2)) != (code+2)) {
     175    if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) {
    176176        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
    177177        return 25;
     
    219219
    220220    // Generate error message and verify return value
    221     if (psErrorMsg("test2A", code, true, "Error code = %d", code) != code ) {
     221    if (psError(code, true, "Error code = %d", code) != code ) {
    222222        psLogMsg("tst_psError02", PS_LOG_ERROR, "Failed return value verify.");
    223223        return 10;
     
    233233
    234234    // Verify the return value of psErrorMsg is the psErrorCode passed
    235     if ( psErrorMsg("test1A", code, true, "Error code = %d", code) != code) {
     235    if ( psError(code, true, "Error code = %d", code) != code) {
    236236        psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return value verify.");
    237237        return 1;
     
    240240
    241241    // test1B empty string in for name argument
    242     if ( psErrorMsg("", code+1, true, "Error code = %d", code+1) != code+1) {
     242    if ( psError(code+1, true, "Error code = %d", code+1) != code+1) {
    243243        psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return with empty string.");
    244244        return 2;
     
    246246    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1B");
    247247
    248     // test1C null pointer in  for name argument
    249     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 
    255248    // test1D undefined code
    256     if ( psErrorMsg("test1D", -1, true, "Error code = %d", -1) != -1) {
     249    if ( psError(-1, true, "Error code = %d", -1) != -1) {
    257250        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with undefined code.");
    258251        return 4;
     
    261254
    262255    // test1E set psErrorMsg argument to false
    263     if( psErrorMsg("test1E", code, false, "Error code = %d", code) != code) {
     256    if( psError(code, false, "Error code = %d", code) != code) {
    264257        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with false new arg.");
    265258        return 5;
     
    268261
    269262    // test1F psErrorMsg with a error code less then PS_ERR_BASE(256)
    270     if( psErrorMsg("test1F", 9, true, "Errno code = %d", 9) != 9) {
     263    if( psError(9, true, "Errno code = %d", 9) != 9) {
    271264        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with errno code.");
    272265        return 6;
     
    287280
    288281    // Test point #1 Multiple type values placed in the error string
    289     psError(__func__,
     282    psError(PS_ERR_UNKNOWN, true,
    290283            "ALL TYPES intval = %d longval = %ld floatval = %f charval = %c strval = %s",
    291284            intval,longval,floatval,charval,stringval);
    292285
    293286    // Test point #2 String values in error message
    294     psError(PS_STRING(__LINE__),"NO VALUES");
     287    psError(PS_ERR_UNKNOWN, true, "NO VALUES");
    295288
    296289    // Test point #3 Empty strings in error message
    297     psError("","");
     290    psError(PS_ERR_UNKNOWN, true, "");
    298291
    299292    return 0;
Note: See TracChangeset for help on using the changeset viewer.