SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stktest_switch.cpp File Reference
#include <stk_config.h>
#include <stk.h>
#include <assert.h>
#include "stktest_context.h"
Include dependency graph for stktest_switch.cpp:

Go to the source code of this file.

Classes

class  stk::test::switch_::TestTask< _AccessMode >
 Switch test task. More...

Namespaces

namespace  stk
 Namespace of STK package.
namespace  stk::test
 Namespace of the test inventory.
namespace  stk::test::switch_
 Namespace of Switch test.

Macros

#define _STK_SWITCH_TEST_TASKS_MAX   3
#define _STK_SWITCH_TEST_CYCLES_MAX   3

Functions

int main (int argc, char **argv)

Variables

 STK_TEST_DECL_ASSERT
static volatile uint8_t stk::test::switch_::g_TaskSwitch = 0
static volatile uint8_t stk::test::switch_::g_Cycles [3] = {}
static Kernel< KERNEL_STATIC, 3, SwitchStrategyRoundRobin, PlatformDefaultstk::test::switch_::kernel
 Kernel.
static TestTask< ACCESS_PRIVILEGEDstk::test::switch_::task1 (0)
 Tasks (threads).
static TestTask< ACCESS_PRIVILEGEDstk::test::switch_::task2 (1)
static TestTask< ACCESS_PRIVILEGEDstk::test::switch_::task3 (2)

Macro Definition Documentation

◆ _STK_SWITCH_TEST_CYCLES_MAX

#define _STK_SWITCH_TEST_CYCLES_MAX   3

Definition at line 22 of file stktest_switch.cpp.

Referenced by stk::test::switch_::TestTask< _AccessMode >::Run().

◆ _STK_SWITCH_TEST_TASKS_MAX

#define _STK_SWITCH_TEST_TASKS_MAX   3

Definition at line 21 of file stktest_switch.cpp.

Referenced by stk::test::switch_::TestTask< _AccessMode >::Run().

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 108 of file stktest_switch.cpp.

109{
110 (void)argc;
111 (void)argv;
112
114
115 using namespace stk;
116 using namespace stk::test;
117 using namespace stk::test::switch_;
118
119 kernel.Initialize();
120
121 kernel.AddTask(&task1);
122 kernel.AddTask(&task2);
123 kernel.AddTask(&task3);
124
125 kernel.Start();
126
128}
Namespace of STK package.
Namespace of the test inventory.
Namespace of Switch test.
static TestTask< ACCESS_PRIVILEGED > task1(0)
Tasks (threads).
static TestTask< ACCESS_PRIVILEGED > task3(2)
static Kernel< KERNEL_STATIC, 3, SwitchStrategyRoundRobin, PlatformDefault > kernel
Kernel.
static TestTask< ACCESS_PRIVILEGED > task2(1)
static void ShowTestSuitePrologue()
Show text string as prologue before tests start.
@ DEFAULT_FAILURE_EXIT_CODE
default exit code for exit() to denote failure of the test

References stk::test::TestContext::DEFAULT_FAILURE_EXIT_CODE, stk::test::switch_::kernel, stk::test::TestContext::ShowTestSuitePrologue(), stk::test::switch_::task1, stk::test::switch_::task2, and stk::test::switch_::task3.

Here is the call graph for this function:

Variable Documentation

◆ STK_TEST_DECL_ASSERT

STK_TEST_DECL_ASSERT

Definition at line 19 of file stktest_switch.cpp.