Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

CUError.h File Reference


Detailed Description

Error handling functions (user interface).

CUnit uses a simple (and conventional) error handling strategy. Functions that can generate errors set (and usually return) an error code to indicate the run status. The error code can be inspected using the CU_get_error() function. A descriptive error message can be retrieved using CU_get_error_msg().

#include <errno.h>

Go to the source code of this file.

Defines

#define get_error()   CU_get_error_msg()
 Deprecated (version 1).

Typedefs

typedef enum CU_ErrorAction CU_ErrorAction
 CUnit error action codes.

Enumerations

enum  CU_ErrorCode {
  CUE_SUCCESS = 0, CUE_NOMEMORY = 1, CUE_NOREGISTRY = 10, CUE_REGISTRY_EXISTS = 11,
  CUE_NOSUITE = 20, CUE_NO_SUITENAME = 21, CUE_SINIT_FAILED = 22, CUE_SCLEAN_FAILED = 23,
  CUE_DUP_SUITE = 24, CUE_NOTEST = 30, CUE_NO_TESTNAME = 31, CUE_DUP_TEST = 32,
  CUE_TEST_NOT_IN_SUITE = 33, CUE_FOPEN_FAILED = 40, CUE_FCLOSE_FAILED = 41, CUE_BAD_FILENAME = 42,
  CUE_WRITE_ERROR = 43
}
 CUnit error codes. More...
enum  CU_ErrorAction { CUEA_IGNORE, CUEA_FAIL, CUEA_ABORT }
 CUnit error action codes. More...

Functions

CU_ErrorCode CU_get_error (void)
 Get the error code.
const char * CU_get_error_msg (void)
 Get the message corresponding to the error code.
void CU_set_error_action (CU_ErrorAction action)
 Set the action to take when an error condition occurs.
CU_ErrorAction CU_get_error_action (void)
 Get the current error action code.
void test_cunit_CUError (void)
void CU_set_error (CU_ErrorCode error)
 Set the error code.


Generated on Thu Apr 28 12:36:09 2005 for CUnit by  doxygen 1.3.9.1