MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / testPost

Function testPost

test/Semaphore/SemaphoreOperationsTestCase.cpp:70–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 */
69
70bool testPost(Semaphore& semaphore)
71{
72 waitForNextTick();
73 const auto start = TickClock::now();
74 const auto ret = semaphore.post();
75 return ret == 0 && start == TickClock::now() && semaphore.getValue() > 0;
76}
77
78/**
79 * \brief Tests Semaphore::tryWait() when semaphore is locked - it must fail immediately and return EAGAIN

Callers 1

phase2Function · 0.85

Calls 3

waitForNextTickFunction · 0.85
postMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected