mirror of https://github.com/ARMmbed/mbed-os.git
Test event IDs going negative
parent
8f67043445
commit
3d7bff6cdb
|
@ -852,6 +852,21 @@ void user_allocated_event_test()
|
||||||
equeue_destroy(&q);
|
equeue_destroy(&q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void id_cycle()
|
||||||
|
{
|
||||||
|
equeue_t q;
|
||||||
|
int err = equeue_create(&q, 10000000);
|
||||||
|
test_assert(!err);
|
||||||
|
|
||||||
|
for (int i = 0; i < 300; i++) {
|
||||||
|
int id = equeue_call(&q, pass_func, 0);
|
||||||
|
test_assert(id != 0);
|
||||||
|
test_assert(equeue_cancel(&q, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
equeue_destroy(&q);
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
printf("beginning tests...\n");
|
printf("beginning tests...\n");
|
||||||
|
@ -881,6 +896,7 @@ int main()
|
||||||
test_run(break_request_cleared_on_timeout);
|
test_run(break_request_cleared_on_timeout);
|
||||||
test_run(sibling_test);
|
test_run(sibling_test);
|
||||||
test_run(user_allocated_event_test);
|
test_run(user_allocated_event_test);
|
||||||
|
test_run(id_cycle);
|
||||||
printf("done!\n");
|
printf("done!\n");
|
||||||
return test_failure;
|
return test_failure;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue