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

Function testTryPopWhenNotEmpty

test/Queue/QueueOperationsTestCase.cpp:92–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 */
91
92bool testTryPopWhenNotEmpty(const QueueWrapper& queueWrapper)
93{
94 OperationCountingType::resetCounters();
95 waitForNextTick();
96 const auto start = TickClock::now();
97 uint8_t priority {};
98 OperationCountingType testValue {}; // 1 construction
99 const auto ret = queueWrapper.tryPop(priority, testValue); // 1 swap, 1 destruction
100 return ret == 0 && start == TickClock::now() && queueWrapper.checkCounters(1, 0, 0, 1, 0, 0, 1) == true;
101}
102
103/**
104 * \brief Tests QueueWrapper::tryPush(..., const T&) when queue is full - it must fail immediately and return EAGAIN

Callers 1

phase2Function · 0.85

Calls 3

waitForNextTickFunction · 0.85
tryPopMethod · 0.45
checkCountersMethod · 0.45

Tested by

no test coverage detected