distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
QueueOperationsTestCase.cpp File Reference

QueueOperationsTestCase class implementation. More...

#include "QueueOperationsTestCase.hpp"
#include "QueueWrappers.hpp"
#include "waitForNextTick.hpp"
#include "distortos/StaticSoftwareTimer.hpp"
#include "distortos/statistics.hpp"
#include <malloc.h>
#include <cerrno>
Include dependency graph for QueueOperationsTestCase.cpp:

Namespaces

 distortos
 Top-level namespace of distortos project.
 
 distortos::test
 Functional tests of distortos project.
 

Functions

bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::testTryPopWhenEmpty (const QueueWrapper &queueWrapper)
 Tests QueueWrapper::tryPop() when queue is empty - it must fail immediately and return EAGAIN. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::testTryPopWhenNotEmpty (const QueueWrapper &queueWrapper)
 Tests QueueWrapper::tryPop() when queue is not empty - it must succeed immediately. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::testTryPushWhenFull (const QueueWrapper &queueWrapper)
 Tests QueueWrapper::tryPush(..., const T&) when queue is full - it must fail immediately and return EAGAIN. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase1 ()
 Phase 1 of test case. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase2 ()
 Phase 2 of test case. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase3 ()
 Phase 3 of test case. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase4 ()
 Phase 4 of test case. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase5 ()
 Phase 5 of test case. More...
 
bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase6 ()
 Phase 6 of test case. More...
 

Variables

constexpr bool distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::falseTrue [] {false, true}
 array with "false" and "true" bool values More...
 
constexpr auto distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::singleDuration = TickClock::duration{1}
 single duration used in tests More...
 
constexpr auto distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::longDuration = singleDuration * 10
 long duration used in tests More...
 
decltype(statistics::getContextSwitchCount()) constexpr distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::waitForNextTickContextSwitchCount {2}
 expected number of context switches in waitForNextTick(): main -> idle -> main More...
 
decltype(statistics::getContextSwitchCount()) constexpr distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase1TryForUntilContextSwitchCount {2}
 
decltype(statistics::getContextSwitchCount()) constexpr distortos::test::anonymous_namespace{QueueOperationsTestCase.cpp}::phase34SoftwareTimerContextSwitchCount {2}
 

Detailed Description

QueueOperationsTestCase class implementation.

Author
Copyright (C) 2015-2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.