Handle failure to schedule callback asynchronously.

Niklas Hauser 2016-03-21 14:45:20 +00:00 committed by Martin Kojtal
parent 95462c1d7c
commit d33aabf7ac
3 changed files with 8 additions and 0 deletions

View File

@ -311,6 +311,10 @@ void Harness::run_next_case()
// if await validation _with_ timeout
if (case_control.timeout < TIMEOUT_FOREVER) {
case_timeout_handle = scheduler.post(handle_timeout, case_control.timeout);
if (case_timeout_handle == NULL) {
raise_failure(REASON_SCHEDULER);
schedule_next_case();
}
}
}
else {

View File

@ -56,6 +56,9 @@ const char* utest::v1::stringify(utest::v1::failure_reason_t reason)
case REASON_CASE_INDEX:
string = "Ignored: Case Index Invalid";
break;
case REASON_SCHEDULER:
string = "Ignored: Scheduling Asynchronous Callback Failed";
break;
default:
case REASON_UNKNOWN:
string = "Ignored: Unknown Failure";

View File

@ -66,6 +66,7 @@ namespace v1 {
REASON_CASE_TEARDOWN = (1 << 9), ///< Case teardown failed
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
};