Skip to content

Commit 3d7bff6

Browse files
committed
Test event IDs going negative
1 parent 8f67043 commit 3d7bff6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

events/source/tests/tests.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,21 @@ void user_allocated_event_test()
852852
equeue_destroy(&q);
853853
}
854854

855+
void id_cycle()
856+
{
857+
equeue_t q;
858+
int err = equeue_create(&q, 10000000);
859+
test_assert(!err);
860+
861+
for (int i = 0; i < 300; i++) {
862+
int id = equeue_call(&q, pass_func, 0);
863+
test_assert(id != 0);
864+
test_assert(equeue_cancel(&q, id));
865+
}
866+
867+
equeue_destroy(&q);
868+
}
869+
855870
int main()
856871
{
857872
printf("beginning tests...\n");
@@ -881,6 +896,7 @@ int main()
881896
test_run(break_request_cleared_on_timeout);
882897
test_run(sibling_test);
883898
test_run(user_allocated_event_test);
899+
test_run(id_cycle);
884900
printf("done!\n");
885901
return test_failure;
886902
}

0 commit comments

Comments
 (0)