QP/C  6.3.7
qutest.c File Reference

QF/C stub for QUTEST unit testing. More...

#include "qf_port.h"
#include "qf_pkg.h"
#include "qassert.h"
#include "qs_port.h"
Include dependency graph for qutest.c:

Go to the source code of this file.

Functions

void QF_init (void)
 QF initialization. More...
 
void QF_stop (void)
 Function invoked by the application layer to stop the QF application and return control to the OS/Kernel. More...
 
int_t QF_run (void)
 Transfers control to QF to run the application. More...
 
void QActive_start_ (QActive *const me, uint_fast8_t prio, QEvt const *qSto[], uint_fast16_t qLen, void *stkSto, uint_fast16_t stkSize, QEvt const *ie)
 Implementation of the active object start operation. More...
 
void QActive_stop (QActive *const me)
 Stops execution of an active object and removes it from the framework's supervision. More...
 
static void QActiveDummy_init_ (QHsm *const me, QEvt const *const e)
 
static void QActiveDummy_dispatch_ (QHsm *const me, QEvt const *const e)
 
static void QActiveDummy_start_ (QActive *const me, uint_fast8_t prio, QEvt const *qSto[], uint_fast16_t qLen, void *stkSto, uint_fast16_t stkSize, QEvt const *ie)
 
static bool QActiveDummy_post_ (QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender)
 
static void QActiveDummy_postLIFO_ (QActive *const me, QEvt const *const e)
 
void QActiveDummy_ctor (QActiveDummy *const me)
 "constructor" of QActiveDummy More...
 
void QS_processTestEvts_ (void)
 QS internal function to process posted events during test. More...
 
void QS_tickX_ (uint_fast8_t const tickRate, void const *const sender)
 internal function to process armed time events during test More...
 
void Q_onAssert (char_t const *const module, int_t loc)
 Callback function invoked in case of any assertion failure. More...
 

Variables

uint8_t volatile QF_intNest
 

Detailed Description

QF/C stub for QUTEST unit testing.

Definition in file qutest.c.

Function Documentation

◆ QF_init()

void QF_init ( void  )

QF initialization.

Definition at line 55 of file qutest.c.

◆ QF_stop()

void QF_stop ( void  )

Function invoked by the application layer to stop the QF application and return control to the OS/Kernel.

Definition at line 66 of file qutest.c.

◆ QF_run()

int_t QF_run ( void  )

Transfers control to QF to run the application.

Definition at line 70 of file qutest.c.

◆ QActive_start_()

void QActive_start_ ( QActive *const  me,
uint_fast8_t  prio,
QEvt const *  qSto[],
uint_fast16_t  qLen,
void *  stkSto,
uint_fast16_t  stkSize,
QEvt const *  ie 
)

Implementation of the active object start operation.

Definition at line 82 of file qutest.c.

◆ QActive_stop()

void QActive_stop ( QActive *const  me)

Stops execution of an active object and removes it from the framework's supervision.

Definition at line 103 of file qutest.c.

◆ QActiveDummy_init_()

static void QActiveDummy_init_ ( QHsm *const  me,
QEvt const *const  e 
)
static

Definition at line 159 of file qutest.c.

◆ QActiveDummy_dispatch_()

static void QActiveDummy_dispatch_ ( QHsm *const  me,
QEvt const *const  e 
)
static

Definition at line 169 of file qutest.c.

◆ QActiveDummy_start_()

static void QActiveDummy_start_ ( QActive *const  me,
uint_fast8_t  prio,
QEvt const *  qSto[],
uint_fast16_t  qLen,
void *  stkSto,
uint_fast16_t  stkSize,
QEvt const *  ie 
)
static

Definition at line 133 of file qutest.c.

◆ QActiveDummy_post_()

static bool QActiveDummy_post_ ( QActive *const  me,
QEvt const *const  e,
uint_fast16_t const  margin,
void const *const  sender 
)
static

Definition at line 179 of file qutest.c.

◆ QActiveDummy_postLIFO_()

static void QActiveDummy_postLIFO_ ( QActive *const  me,
QEvt const *const  e 
)
static

Definition at line 233 of file qutest.c.

◆ QActiveDummy_ctor()

void QActiveDummy_ctor ( QActiveDummy *const  me)

"constructor" of QActiveDummy

Constructor of the QActiveDummy Active Object class.

Definition at line 121 of file qutest.c.

◆ QS_processTestEvts_()

void QS_processTestEvts_ ( void  )

QS internal function to process posted events during test.

Definition at line 279 of file qutest.c.

◆ QS_tickX_()

void QS_tickX_ ( uint_fast8_t const  tickRate,
void const *const  sender 
)

internal function to process armed time events during test

Definition at line 314 of file qutest.c.

◆ Q_onAssert()

void Q_onAssert ( char_t const *const  module,
int_t  location 
)

Callback function invoked in case of any assertion failure.

Description
This is an application-specific callback function needs to be defined in the application to perform the clean system shutdown and perhaps a reset.
Parameters
[in]modulename of the file/module in which the assertion failed (constant, zero-terminated C string)
[in]loclocation of the assertion within the module. This could be a line number or a user-specified ID-number.
Note
This callback function should not return, as continuation after an assertion failure does not make sense.
The Q_onAssert() function is the last line of defense after the system failure and its implementation shouild be very carefully designed and tested under various fault conditions, including but not limited to: stack overflow, stack corruption, or calling Q_onAssert() from an interrupt.
It is typically a bad idea to implement Q_onAssert() as an endless loop that ties up the CPU. During debuggin, Q_onAssert() is an ideal place to put a breakpoint.

Called by the following macros: Q_ASSERT, Q_REQUIRE, Q_ENSURE, Q_ERROR, Q_ALLEGE as well as Q_ASSERT_ID, Q_REQUIRE_ID, Q_ENSURE_ID, Q_ERROR_ID, and Q_ALLEGE_ID.

Definition at line 419 of file qutest.c.

Variable Documentation

◆ QF_intNest

uint8_t volatile QF_intNest

Definition at line 52 of file qutest.c.