mirror of https://github.com/ARMmbed/mbed-os.git
Use negative numbers for `status_t`.
parent
2ee605a4ec
commit
014b3fef1f
|
@ -118,7 +118,7 @@ status_t utest::v1::greentea_case_teardown_handler(const Case *const source, con
|
||||||
status_t utest::v1::greentea_case_failure_abort_handler(const Case *const source, const failure_t failure)
|
status_t utest::v1::greentea_case_failure_abort_handler(const Case *const source, const failure_t failure)
|
||||||
{
|
{
|
||||||
status_t status = verbose_case_failure_handler(source, failure);
|
status_t status = verbose_case_failure_handler(source, failure);
|
||||||
return (status & STATUS_IGNORE) ? STATUS_IGNORE : STATUS_ABORT;
|
return (status == STATUS_IGNORE) ? STATUS_IGNORE : STATUS_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t utest::v1::greentea_case_failure_continue_handler(const Case *const source, const failure_t failure)
|
status_t utest::v1::greentea_case_failure_continue_handler(const Case *const source, const failure_t failure)
|
||||||
|
|
|
@ -111,16 +111,16 @@ void Harness::raise_failure(const failure_reason_t reason)
|
||||||
|
|
||||||
if (handlers.test_failure) handlers.test_failure(failure_t(reason, location));
|
if (handlers.test_failure) handlers.test_failure(failure_t(reason, location));
|
||||||
if (handlers.case_failure) fail_status = handlers.case_failure(case_current, failure_t(reason, location));
|
if (handlers.case_failure) fail_status = handlers.case_failure(case_current, failure_t(reason, location));
|
||||||
if (!(fail_status & STATUS_IGNORE)) case_failed++;
|
if (fail_status != STATUS_IGNORE) case_failed++;
|
||||||
|
|
||||||
if ((fail_status & STATUS_ABORT) && case_timeout_handle)
|
if ((fail_status == STATUS_ABORT) && case_timeout_handle)
|
||||||
{
|
{
|
||||||
minar::Scheduler::cancelCallback(case_timeout_handle);
|
minar::Scheduler::cancelCallback(case_timeout_handle);
|
||||||
case_timeout_handle = NULL;
|
case_timeout_handle = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fail_status & STATUS_ABORT || reason & REASON_CASE_SETUP) {
|
if (fail_status == STATUS_ABORT || reason & REASON_CASE_SETUP) {
|
||||||
if (handlers.case_teardown && location != LOCATION_CASE_TEARDOWN) {
|
if (handlers.case_teardown && location != LOCATION_CASE_TEARDOWN) {
|
||||||
location_t fail_loc(location);
|
location_t fail_loc(location);
|
||||||
location = LOCATION_CASE_TEARDOWN;
|
location = LOCATION_CASE_TEARDOWN;
|
||||||
|
@ -131,7 +131,7 @@ void Harness::raise_failure(const failure_reason_t reason)
|
||||||
else handlers.case_teardown = NULL;
|
else handlers.case_teardown = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fail_status & STATUS_ABORT) {
|
if (fail_status == STATUS_ABORT) {
|
||||||
test_failed++;
|
test_failed++;
|
||||||
failure_t fail(reason, location);
|
failure_t fail(reason, location);
|
||||||
location = LOCATION_TEST_TEARDOWN;
|
location = LOCATION_TEST_TEARDOWN;
|
||||||
|
|
|
@ -45,9 +45,9 @@ namespace v1 {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum status_t {
|
enum status_t {
|
||||||
STATUS_CONTINUE = 0, ///< continues testing
|
STATUS_CONTINUE = -1, ///< continues testing
|
||||||
STATUS_IGNORE = 1, ///< ignores failure and continues testing
|
STATUS_IGNORE = -2, ///< ignores failure and continues testing
|
||||||
STATUS_ABORT = 2 ///< stops testing
|
STATUS_ABORT = -3 ///< stops testing
|
||||||
};
|
};
|
||||||
|
|
||||||
enum failure_reason_t {
|
enum failure_reason_t {
|
||||||
|
|
Loading…
Reference in New Issue