We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 874ff1f commit 48fdd33Copy full SHA for 48fdd33
TESTS/mbed_drivers/timeout/timeout_tests.h
@@ -196,13 +196,14 @@ void test_multiple(void)
196
template<typename T>
197
void test_no_wait(void)
198
{
199
- Semaphore sem(0, 1);
200
- T timeout;
201
- timeout.attach_callback(mbed::callback(sem_callback, &sem), 0ULL);
202
-
203
- bool acquired = sem.try_acquire();
204
- TEST_ASSERT_TRUE(acquired);
205
- timeout.detach();
+ for (int i = 0; i < 100; i++) {
+ Semaphore sem(0, 1);
+ T timeout;
+ timeout.attach_callback(mbed::callback(sem_callback, &sem), 0ULL);
+ int32_t sem_slots = sem.wait(0);
+ TEST_ASSERT_EQUAL(1, sem_slots);
+ timeout.detach();
206
+ }
207
}
208
209
/** Template for tests: accuracy of timeout delay
0 commit comments