File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,14 @@ void test_multi_ticker(void)
80
80
}
81
81
82
82
Thread::wait (MULTI_TICKER_TIME_MS + extra_wait);
83
+ TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
84
+
83
85
for (int i = 0 ; i < TICKER_COUNT; i++) {
84
86
ticker[i].detach ();
85
87
}
88
+ // Because detach calls schedule_interrupt in some circumstances
89
+ // (e.g. when head event is removed), it's good to check if
90
+ // no more callbacks were triggered during detaching.
86
91
TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
87
92
88
93
multi_counter = 0 ;
@@ -91,9 +96,14 @@ void test_multi_ticker(void)
91
96
}
92
97
93
98
Thread::wait (MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
99
+ TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
100
+
94
101
for (int i = 0 ; i < TICKER_COUNT; i++) {
95
102
ticker[i].detach ();
96
103
}
104
+ // Because detach calls schedule_interrupt in some circumstances
105
+ // (e.g. when head event is removed), it's good to check if
106
+ // no more callbacks were triggered during detaching.
97
107
TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
98
108
}
99
109
Original file line number Diff line number Diff line change @@ -196,9 +196,14 @@ void test_multi_ticker(void)
196
196
}
197
197
198
198
Thread::wait (MULTI_TICKER_TIME_MS + extra_wait);
199
+ TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
200
+
199
201
for (int i = 0 ; i < TICKER_COUNT; i++) {
200
202
ticker[i].detach ();
201
203
}
204
+ // Because detach calls schedule_interrupt in some circumstances
205
+ // (e.g. when head event is removed), it's good to check if
206
+ // no more callbacks were triggered during detaching.
202
207
TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
203
208
204
209
multi_counter = 0 ;
@@ -207,9 +212,14 @@ void test_multi_ticker(void)
207
212
}
208
213
209
214
Thread::wait (MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
215
+ TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
216
+
210
217
for (int i = 0 ; i < TICKER_COUNT; i++) {
211
218
ticker[i].detach ();
212
219
}
220
+ // Because detach calls schedule_interrupt in some circumstances
221
+ // (e.g. when head event is removed), it's good to check if
222
+ // no more callbacks were triggered during detaching.
213
223
TEST_ASSERT_EQUAL (TICKER_COUNT, multi_counter);
214
224
}
215
225
You can’t perform that action at this time.
0 commit comments