IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 27, 2019, 11:57:38 AM (6 years ago)
Author:
eugene
Message:

updates to psLib tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sys/tap_psError.c

    r17515 r41171  
    324324
    325325        for (psS32 i = 0; i < numErr; i++) {
    326             const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
    327             ok(desc != NULL,
    328                 "psErrorCode didn't find registered error code.");
    329 
    330             ok(strcmp(desc,errDesc[i].description) == 0,
    331                 "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.", desc,errDesc[i].description);
    332         }
    333 
    334         /*
    335             2. invoke psErrorCodeString with a static/builtin psLib error code. Verify:
     326            const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
     327            ok(desc, "psErrorCode found registered error code.");
     328            ok(!strcmp(desc,errDesc[i].description), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, errDesc[i].description);
     329        }
     330
     331        /* 2. invoke psErrorCodeString with a static/builtin psLib error code. Verify:
    336332                a. the result is correct.
    337333        */
    338         const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES);
    339         ok(desc != NULL, "psErrorCode didn't find static error code.");
    340         ok(strcmp(desc,"error classes end marker") == 0,
    341             "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
    342             desc,"error classes end marker");
     334        const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES);
     335        ok(desc, "psErrorCode found static error code.");
     336        ok(!strcmp(desc, "error classes end marker"), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, "error classes end marker");
    343337
    344338        desc = psErrorCodeString(PS_ERR_NONE);
    345         ok(desc != NULL,
    346             "psErrorCode didn't find static error code.");
    347         ok(strcmp(desc,"not an error") == 0,
    348             "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
    349             desc,"not an error");
     339        ok(desc, "psErrorCode found static error code.");
     340        ok(!strcmp(desc,"not an error"), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, "not an error");
    350341   
    351         /*
    352             3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned.
    353         */
     342        /* 3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned. */
    354343        desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+numErr+1);
    355         ok(desc == NULL,
    356             "psErrorCode didn't return a NULL with a bogus input code.");
    357 
    358         /*
    359             4. invoke psErrorRegister with a NULL psErrorDescription. Verify that:
     344        ok(!desc, "psErrorCode returns a NULL with a bogus input code.");
     345
     346        /* 4. invoke psErrorRegister with a NULL psErrorDescription. Verify that:
    360347                a. the execution does not cease.
    361348                b. an appropriate error is generated.
     
    366353        psErr* err = psErrorLast();
    367354        ok(err->code == PS_ERR_BAD_PARAMETER_NULL,
    368         "psErrorCode didn't generate proper error code for NULL input.");
     355        "psErrorCode generated proper error code for NULL input.");
    369356
    370357        psFree(err);
     
    377364        err = psErrorLast();
    378365        ok(err->code == PS_ERR_NONE,
    379             "psErrorCode generated an error for nErrors = 0.");
     366            "psErrorCode did not generate an error for nErrors = 0.");
    380367        psFree(err);
    381368    }
Note: See TracChangeset for help on using the changeset viewer.