IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1878


Ignore:
Timestamp:
Sep 24, 2004, 9:46:30 AM (22 years ago)
Author:
evanalst
Message:

Add addition test case for psErrorClear test.

File:
1 edited

Legend:

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

    r1875 r1878  
    77 *     testError01 - psErrorMsg(), psErrorStackPrint()  (Testpoint #725)
    88 *     testError02 - psErrorStackPrintV()               (Testpoint #726)
    9  *     testError03 - psErrorGet(), psErrorLast()        (Testpoint #)
     9 *     testError03 - psErrorGet(), psErrorLast()        (Testpoint #727)
    1010 *     testError04 - psErrorClear()                     (Testpoint #)
    1111 *     testError05 - psErrorCodeString()                (Testpoint #)
     
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2004-09-24 02:00:15 $
     15 *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2004-09-24 19:46:30 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8484    psErr *lastAfterClear = NULL;
    8585
    86     // Generate three error messages
     86    // With an attemp error stack call psErrorClear
     87    psErrorClear();
     88
     89    // Get the last error message and verify PS_ERR_NONE (empty stack)
     90    lastAfterClear = psErrorLast();
     91    if(lastAfterClear->code != PS_ERR_NONE) {
     92        psLogMsg("tst_psError05", PS_LOG_ERROR, "psErrorLast did not return expected.");
     93        return 30;
     94    }
     95    psFree(lastAfterClear);
     96
     97    // Generate three error messages to have messages on error stack
    8798    if (psErrorMsg("test4A", code, true, "Error code = %d", code) !=  code) {
    8899        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    89         return 30;
     100        return 31;
    90101    }
    91102    if (psErrorMsg("test4A", (code+1), false, "Error code = %d", (code+1)) != (code+1)) {
    92103        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    93         return 31;
     104        return 32;
    94105    }
    95106    if (psErrorMsg("test4A", (code+2), false, "Error code = %d", (code+2)) != (code+2)) {
    96107        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
    97         return 32;
     108        return 33;
    98109    }
    99110
     
    102113    if(last->code != (code+2)) {
    103114        psLogMsg("tst_psError04", PS_LOG_ERROR, "psErrorLast did not return expected.");
    104         return 33;
     115        return 34;
    105116    }
    106117    psFree(last);
     
    111122    // Get the last error message after clear and verify is has PS_ERR_NONE code
    112123    lastAfterClear = psErrorLast();
    113     if(last->code != PS_ERR_NONE) {
    114         psLogMsg("tst_psError05", PS_LOG_ERROR, "psErrorLaster did not return expected.");
    115         return 34;
     124    if(lastAfterClear->code != PS_ERR_NONE) {
     125        psLogMsg("tst_psError05", PS_LOG_ERROR, "psErrorLast did not return expected.");
     126        return 35;
    116127    }
    117128    psFree(lastAfterClear);
Note: See TracChangeset for help on using the changeset viewer.