![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
#include <stk_config.h>#include <stk.h>#include <time/stk_time_timer.h>#include <assert.h>#include <string.h>#include "stktest_context.h"Go to the source code of this file.
Classes | |
| class | stk::test::timer::TestTimer |
| Concrete timer implementation that increments g_ExpiredCount on each expiry. More... | |
| class | stk::test::timer::OneShotTimerTask< _AccessMode > |
| Tests that a one-shot timer fires exactly once at the expected time. More... | |
| class | stk::test::timer::PeriodicTimerTask< _AccessMode > |
| Tests that a periodic timer fires repeatedly at regular intervals. More... | |
| class | stk::test::timer::MultipleTimersTask< _AccessMode > |
| Tests that multiple concurrent timers with different periods fire independently. More... | |
| class | stk::test::timer::StopTimerTask< _AccessMode > |
| Tests that Stop() cancels a pending timer before it fires. More... | |
| class | stk::test::timer::ResetPeriodicTimerTask< _AccessMode > |
| Tests that Reset() reanchors a periodic timer's deadline from now. More... | |
| class | stk::test::timer::RestartTimerTask< _AccessMode > |
| Tests that Restart() atomically stops and re-starts a timer. More... | |
| class | stk::test::timer::StartOrResetTask< _AccessMode > |
| Tests StartOrReset(): starts if inactive, resets if active+periodic. More... | |
| class | stk::test::timer::SetPeriodTask< _AccessMode > |
| Tests SetPeriod(): changes reload period without affecting current deadline. More... | |
| class | stk::test::timer::StressTestTask< _AccessMode > |
| Stress test of TimerHost under full five-task contention. More... | |
Namespaces | |
| namespace | stk |
| Namespace of STK package. | |
| namespace | stk::test |
| Namespace of the test inventory. | |
| namespace | stk::test::timer |
| Namespace of TimerHost test. | |
Macros | |
| #define | _STK_TIMER_TEST_TIMEOUT 1000 |
| #define | _STK_TIMER_TEST_SHORT_SLEEP 10 |
| #define | _STK_TIMER_TEST_LONG_SLEEP 100 |
| #define | _STK_TIMER_STACK_SIZE 256 |
| #define | _STK_TIMER_TEST_TASKS_MAX 5 |
| #define | STK_TASK static |
Functions | |
| static void | stk::test::timer::ResetTestState () |
| static bool | NeedsExtendedTasks (const char *test_name) |
| template<class TaskType> | |
| static int32_t | RunTest (const char *test_name, int32_t param=0) |
| int | main (int argc, char **argv) |
Variables | |
| STK_TEST_DECL_ASSERT | |
| static volatile int32_t | stk::test::timer::g_TestResult = 0 |
| static volatile int32_t | stk::test::timer::g_SharedCounter = 0 |
| static volatile int32_t | stk::test::timer::g_ExpiredCount = 0 |
| static sync::Event | stk::test::timer::g_LastExpired [5] |
| static volatile int64_t | stk::test::timer::g_ExpiredTime [5] = {0} |
| static Kernel< KERNEL_DYNAMIC|KERNEL_SYNC, 5+stk::time::TimerHost::TASK_COUNT, SwitchStrategyRR, PlatformDefault > | stk::test::timer::g_Kernel |
| static time::TimerHost | stk::test::timer::g_TimerHost |
| #define _STK_TIMER_STACK_SIZE 256 |
Definition at line 26 of file test_timerhost.cpp.
| #define _STK_TIMER_TEST_LONG_SLEEP 100 |
Definition at line 25 of file test_timerhost.cpp.
Referenced by stk::test::timer::OneShotTimerTask< _AccessMode >::Run(), stk::test::timer::RestartTimerTask< _AccessMode >::Run(), and stk::test::timer::StopTimerTask< _AccessMode >::Run().
| #define _STK_TIMER_TEST_SHORT_SLEEP 10 |
Definition at line 24 of file test_timerhost.cpp.
Referenced by stk::test::timer::OneShotTimerTask< _AccessMode >::Run(), stk::test::timer::ResetPeriodicTimerTask< _AccessMode >::Run(), stk::test::timer::RestartTimerTask< _AccessMode >::Run(), stk::test::timer::SetPeriodTask< _AccessMode >::Run(), stk::test::timer::StartOrResetTask< _AccessMode >::Run(), and stk::test::timer::StressTestTask< _AccessMode >::Run().
| #define _STK_TIMER_TEST_TASKS_MAX 5 |
Definition at line 31 of file test_timerhost.cpp.
Referenced by stk::test::timer::ResetTestState(), and stk::test::timer::StressTestTask< _AccessMode >::Run().
| #define _STK_TIMER_TEST_TIMEOUT 1000 |
Definition at line 23 of file test_timerhost.cpp.
| #define STK_TASK static |
Definition at line 32 of file test_timerhost.cpp.
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 738 of file test_timerhost.cpp.
References stk::test::TestContext::DEFAULT_FAILURE_EXIT_CODE, stk::test::timer::g_Kernel, stk::test::timer::g_TimerHost, RunTest(), stk::test::TestContext::ShowTestSuiteEpilogue(), stk::test::TestContext::ShowTestSuitePrologue(), and stk::test::TestContext::SUCCESS_EXIT_CODE.
|
static |
Definition at line 683 of file test_timerhost.cpp.
Referenced by RunTest().
|
static |
Definition at line 692 of file test_timerhost.cpp.
References stk::ACCESS_PRIVILEGED, stk::test::TestContext::DEFAULT_FAILURE_EXIT_CODE, stk::test::timer::g_Kernel, stk::test::timer::g_TestResult, stk::test::timer::g_TimerHost, NeedsExtendedTasks(), stk::test::timer::ResetTestState(), STK_TASK, and stk::test::TestContext::SUCCESS_EXIT_CODE.
| STK_TEST_DECL_ASSERT |
Definition at line 21 of file test_timerhost.cpp.