@@ -27,9 +27,9 @@ using utest::v1::Case;
27
27
*/
28
28
void test_system_errors ()
29
29
{
30
- MbedErrorStatus error = MAKE_ERROR (MODULE_APPLICATION, ERROR_CODE_UNKNOWN);
30
+ mbed_error_status_t error = MAKE_ERROR (MODULE_APPLICATION, ERROR_CODE_UNKNOWN);
31
31
SET_WARNING (error, " Error Unknown" , 0xAABBCCDD );
32
- MbedErrorStatus lastError = get_last_error ();
32
+ mbed_error_status_t lastError = get_last_error ();
33
33
printf (" \n lastError = 0x%08X" , lastError );
34
34
TEST_ASSERT_EQUAL_UINT (error, lastError);
35
35
@@ -57,9 +57,9 @@ void test_system_errors()
57
57
*/
58
58
void test_custom_errors ()
59
59
{
60
- MbedErrorStatus error = MAKE_CUSTOM_ERROR (MODULE_APPLICATION, ERROR_CODE_UNKNOWN);
60
+ mbed_error_status_t error = MAKE_CUSTOM_ERROR (MODULE_APPLICATION, ERROR_CODE_UNKNOWN);
61
61
SET_WARNING (error, " Custom Error Unknown" , 0x1234 );
62
- MbedErrorStatus lastError = get_last_error ();
62
+ mbed_error_status_t lastError = get_last_error ();
63
63
printf (" \n lastError = 0x%08X" , lastError );
64
64
TEST_ASSERT_EQUAL_UINT (error, lastError);
65
65
@@ -82,7 +82,7 @@ void test_custom_errors()
82
82
void test_posix_errors ()
83
83
{
84
84
SET_WARNING (ERROR_EPERM, " Posix Error Eperm" , 0x1234 );
85
- MbedErrorStatus lastError = get_last_error ();
85
+ mbed_error_status_t lastError = get_last_error ();
86
86
printf (" \n lastError = 0x%08X" , lastError );
87
87
TEST_ASSERT_EQUAL_UINT (ERROR_EPERM, lastError);
88
88
@@ -113,7 +113,7 @@ void test_first_and_last_error_capture()
113
113
SET_WARNING (ERROR_MUTEX_UNLOCK_FAILED, " Mutex unlock failed" , 0x99AA );
114
114
SET_WARNING (ERROR_SEMAPHORE_UNLOCK_FAILED, " Semaphore unlock failed" , 0xBBCC );
115
115
116
- MbedErrorStatus error = get_last_error ();
116
+ mbed_error_status_t error = get_last_error ();
117
117
printf (" \n lastError = 0x%08X" , error );
118
118
TEST_ASSERT_EQUAL_UINT (ERROR_SEMAPHORE_UNLOCK_FAILED, error);
119
119
@@ -149,13 +149,13 @@ void test_error_count_and_reset()
149
149
void test_error_encoding ()
150
150
{
151
151
SET_WARNING (ERROR_OUT_OF_RESOURCES, " System type error" , 0x1100 );
152
- MbedErrorStatus lastError = get_last_error ();
152
+ mbed_error_status_t lastError = get_last_error ();
153
153
printf (" \n lastError = 0x%08X" , lastError );
154
154
TEST_ASSERT_EQUAL_UINT (ERROR_TYPE_SYSTEM, GET_MBED_ERROR_TYPE (lastError));
155
155
TEST_ASSERT_EQUAL_UINT (MODULE_UNKNOWN, GET_MBED_ERROR_MODULE (lastError));
156
156
TEST_ASSERT_EQUAL_UINT (ERROR_CODE_OUT_OF_RESOURCES, GET_MBED_ERROR_CODE (lastError));
157
157
158
- MbedErrorStatus error = MAKE_CUSTOM_ERROR (MODULE_PLATFORM, ERROR_CODE_CREATE_FAILED);
158
+ mbed_error_status_t error = MAKE_CUSTOM_ERROR (MODULE_PLATFORM, ERROR_CODE_CREATE_FAILED);
159
159
SET_WARNING (error, " Custom Error Type" , 0x2233 );
160
160
lastError = get_last_error ();
161
161
printf (" \n lastError = 0x%08X" , lastError );
@@ -202,11 +202,11 @@ void test_error_value()
202
202
mbed_error_ctx error_ctx = {0 };
203
203
204
204
SET_WARNING (ERROR_OUT_OF_RESOURCES, " System type error" , error_value );
205
- MbedErrorStatus status = get_last_error_log_info ( &error_ctx );
205
+ mbed_error_status_t status = get_last_error_log_info ( &error_ctx );
206
206
TEST_ASSERT (status == ERROR_SUCCESS);
207
207
TEST_ASSERT_EQUAL_UINT (error_value, error_ctx.error_value );
208
208
209
- MbedErrorStatus error = MAKE_CUSTOM_ERROR (MODULE_PLATFORM, ERROR_CODE_CREATE_FAILED);
209
+ mbed_error_status_t error = MAKE_CUSTOM_ERROR (MODULE_PLATFORM, ERROR_CODE_CREATE_FAILED);
210
210
error_value = 0xABCD ;
211
211
SET_WARNING (error, " Custom Error Type" , error_value);
212
212
status = get_last_error_log_info ( &error_ctx );
@@ -228,7 +228,7 @@ void test_error_context_capture()
228
228
mbed_error_ctx error_ctx = {0 };
229
229
230
230
SET_WARNING (ERROR_INVALID_ARGUMENT, " System type error" , error_value );
231
- MbedErrorStatus status = get_last_error_log_info ( &error_ctx );
231
+ mbed_error_status_t status = get_last_error_log_info ( &error_ctx );
232
232
TEST_ASSERT (status == ERROR_SUCCESS);
233
233
TEST_ASSERT_EQUAL_UINT (error_value, error_ctx.error_value );
234
234
TEST_ASSERT_EQUAL_UINT (osThreadGetId (), error_ctx.thread_id );
@@ -258,7 +258,7 @@ void test_error_logging()
258
258
SET_WARNING (ERROR_INVALID_SIZE, " Invalid size error" , 2 );
259
259
SET_WARNING (ERROR_INVALID_FORMAT, " Invalid format error" , 3 );
260
260
261
- MbedErrorStatus status = get_error_log_info ( 0 , &error_ctx );
261
+ mbed_error_status_t status = get_error_log_info ( 0 , &error_ctx );
262
262
TEST_ASSERT_EQUAL_UINT (ERROR_INVALID_ARGUMENT, error_ctx.error_status );
263
263
TEST_ASSERT_EQUAL_UINT (1 , error_ctx.error_value );
264
264
@@ -319,7 +319,7 @@ void test_error_logging()
319
319
#define NUM_TEST_THREADS 10
320
320
321
321
// Error logger threads
322
- void err_thread_func (MbedErrorStatus *error_status)
322
+ void err_thread_func (mbed_error_status_t *error_status)
323
323
{
324
324
// printf("\nError Status = 0x%08X\n",*error_status);
325
325
SET_WARNING (*error_status, " Error from Multi-Threaded error logging test" , *error_status );
@@ -333,7 +333,7 @@ void test_error_logging_multithread()
333
333
mbed_error_ctx error_ctx = {0 };
334
334
int i=0 ;
335
335
Thread errThread[NUM_TEST_THREADS];
336
- MbedErrorStatus error_status[NUM_TEST_THREADS] = {
336
+ mbed_error_status_t error_status[NUM_TEST_THREADS] = {
337
337
ERROR_INVALID_ARGUMENT, ERROR_INVALID_DATA_DETECTED, ERROR_INVALID_FORMAT, ERROR_INVALID_SIZE, ERROR_INVALID_OPERATION,
338
338
ERROR_ITEM_NOT_FOUND, ERROR_ACCESS_DENIED, ERROR_FAILED_OPERATION, ERROR_OPERATION_PROHIBITED, ERROR_OPERATION_ABORTED
339
339
};
@@ -350,7 +350,7 @@ void test_error_logging_multithread()
350
350
i = get_error_log_count ()-1 ;
351
351
// printf("\nError log count = %d\n", i+1);
352
352
for (;i>=0 ;--i) {
353
- MbedErrorStatus status = get_error_log_info ( i, &error_ctx );
353
+ mbed_error_status_t status = get_error_log_info ( i, &error_ctx );
354
354
if (status != ERROR_SUCCESS) {
355
355
TEST_FAIL ();
356
356
}
0 commit comments