CUnit Programmers Reference  3.0
Macros | Typedefs | Enumerations | Functions
CUError.h File Reference

Error handling functions (user interface). More...

#include <errno.h>
#include "CUnit/CUnit.h"

Go to the source code of this file.

Macros

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

Typedefs

typedef enum CU_ErrorAction CU_ErrorAction
 CUnit error action codes. More...
 

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_SUITE_INACTIVE = 25 , CUE_NOTEST = 30 , CUE_NO_TESTNAME = 31 ,
  CUE_DUP_TEST = 32 , CUE_TEST_NOT_IN_SUITE = 33 , CUE_TEST_INACTIVE = 34 , 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_EXPORT CU_ErrorCode CU_get_error (void)
 Retrieves the current CUnit framework error code. More...
 
CU_EXPORT const char * CU_get_error_msg (void)
 Retrieves a message corresponding to the current framework error code. More...
 
CU_EXPORT void CU_set_error_action (CU_ErrorAction action)
 Sets the action to take when a framework error condition occurs. More...
 
CU_EXPORT CU_ErrorAction CU_get_error_action (void)
 Retrieves the current framework error action code. More...
 
CU_EXPORT void CU_set_error (CU_ErrorCode error)
 Sets the CUnit framework error code. More...
 

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().