mirror of https://github.com/ARMmbed/mbed-os.git
Handle failure to schedule callback asynchronously.
parent
95462c1d7c
commit
d33aabf7ac
|
@ -311,6 +311,10 @@ void Harness::run_next_case()
|
||||||
// if await validation _with_ timeout
|
// if await validation _with_ timeout
|
||||||
if (case_control.timeout < TIMEOUT_FOREVER) {
|
if (case_control.timeout < TIMEOUT_FOREVER) {
|
||||||
case_timeout_handle = scheduler.post(handle_timeout, case_control.timeout);
|
case_timeout_handle = scheduler.post(handle_timeout, case_control.timeout);
|
||||||
|
if (case_timeout_handle == NULL) {
|
||||||
|
raise_failure(REASON_SCHEDULER);
|
||||||
|
schedule_next_case();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -56,6 +56,9 @@ const char* utest::v1::stringify(utest::v1::failure_reason_t reason)
|
||||||
case REASON_CASE_INDEX:
|
case REASON_CASE_INDEX:
|
||||||
string = "Ignored: Case Index Invalid";
|
string = "Ignored: Case Index Invalid";
|
||||||
break;
|
break;
|
||||||
|
case REASON_SCHEDULER:
|
||||||
|
string = "Ignored: Scheduling Asynchronous Callback Failed";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
case REASON_UNKNOWN:
|
case REASON_UNKNOWN:
|
||||||
string = "Ignored: Unknown Failure";
|
string = "Ignored: Unknown Failure";
|
||||||
|
|
|
@ -66,6 +66,7 @@ namespace v1 {
|
||||||
REASON_CASE_TEARDOWN = (1 << 9), ///< Case teardown failed
|
REASON_CASE_TEARDOWN = (1 << 9), ///< Case teardown failed
|
||||||
|
|
||||||
REASON_CASE_INDEX = (1 << 10), ///< Case index out-of-range
|
REASON_CASE_INDEX = (1 << 10), ///< Case index out-of-range
|
||||||
|
REASON_SCHEDULER = (1 << 11), ///< Asynchronous callback scheduling failed
|
||||||
|
|
||||||
REASON_IGNORE = 0x8000 ///< The failure may be ignored
|
REASON_IGNORE = 0x8000 ///< The failure may be ignored
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue