Adding unit test and refactoring
Added unit test for errormanager and refactored to simplify use of error_check() method.
This commit is contained in:
@@ -12,16 +12,27 @@
|
||||
|
||||
#define ERR_MAXMSG 256
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct error_s {
|
||||
int error_status;
|
||||
int error_status;
|
||||
void (*p_msg_lookup)(int, char*, int);
|
||||
} error_handle_t;
|
||||
|
||||
error_handle_t* error_new_manager(void (*p_error_message)(int, char*, int));
|
||||
void error_dst_manager(error_handle_t* error_handle);
|
||||
|
||||
int error_set(error_handle_t* error_handle, int errorcode);
|
||||
char* error_check(error_handle_t* error_handle);
|
||||
int error_set(error_handle_t* error_handle, int error_code);
|
||||
int error_check(error_handle_t* error_handle, char **error_message);
|
||||
void error_clear(error_handle_t* error_handle);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ERRORMANAGER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user