2016-07-25 15:18:34 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include "minunit.h"
|
|
|
|
|
2016-07-26 11:00:54 +00:00
|
|
|
#include "mh/errors.h"
|
2016-07-25 15:18:34 +00:00
|
|
|
|
|
|
|
char error_buf[256];
|
|
|
|
|
|
|
|
static char *test_error_messages_exist(void) {
|
|
|
|
int i = -1;
|
|
|
|
for (; i > MH_E_LAST; i--) {
|
2016-07-27 09:45:53 +00:00
|
|
|
sprintf(error_buf, "error code %d has no message", i);
|
2016-07-29 17:05:11 +00:00
|
|
|
mu_assert(error_buf, strlen(mh_error_string(i)) > 0);
|
|
|
|
mu_assert(error_buf,
|
|
|
|
strcmp(mh_error_string(-10000), mh_error_string(i)) != 0);
|
2016-07-25 15:18:34 +00:00
|
|
|
}
|
|
|
|
|
2016-07-26 15:53:52 +00:00
|
|
|
return NULL;
|
2016-07-25 15:18:34 +00:00
|
|
|
}
|
|
|
|
|
2016-07-26 09:57:05 +00:00
|
|
|
static char *mu_all_tests(void) {
|
2016-07-25 15:18:34 +00:00
|
|
|
mu_run_test(test_error_messages_exist);
|
2016-07-26 15:53:52 +00:00
|
|
|
return NULL;
|
2016-07-25 15:18:34 +00:00
|
|
|
}
|