10#include <stk_config.h>
21#define _STK_SWITCH_TEST_TASKS_MAX 3
22#define _STK_SWITCH_TEST_CYCLES_MAX 3
39template <EAccessMode _AccessMode>
52 volatile float count_skip = 0;
63 printf(
"id=%d c=%d\n", task_id,
g_Cycles[task_id]);
Top-level STK include. Provides the Kernel class template and all built-in task-switching strategies.
#define STK_TEST_DECL_ASSERT
Declare assertion redirector in the source file.
#define STK_TEST_CHECK_EQUAL(expected, actual)
Compare values for equality.
#define _STK_SWITCH_TEST_TASKS_MAX
int main(int argc, char **argv)
#define _STK_SWITCH_TEST_CYCLES_MAX
Namespace of STK package.
void Delay(uint32_t ticks)
Delay calling process by busy-waiting until the deadline expires.
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 volatile uint8_t g_TaskSwitch
static volatile uint8_t g_Cycles[3]
Concrete implementation of IKernel.
Task(const Task &)=delete
static void ShowTestSuitePrologue()
Show text string as prologue before tests start.
static void ForceExitTestSuite(int32_t result)
Exit test suite process forcibly.
@ DEFAULT_FAILURE_EXIT_CODE
default exit code for exit() to denote failure of the test
@ SUCCESS_EXIT_CODE
exit code for exit() to denote the success of the test
TestTask(uint8_t task_id)
void Run()
Entry point of the user task.