Adding unit test and refactoring

Added unit test for errormanager and refactored to simplify use of error_check() method.
This commit is contained in:
Michael Tryby
2019-03-20 15:43:27 -04:00
parent 01eb164fdc
commit 7eadbc25ce
5 changed files with 141 additions and 36 deletions

View File

@@ -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_ */