QP/C  7.2.2
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qutest.c File Reference

QUTest unit testing harness. More...

#include "qf_port.h"
#include "qf_pkg.h"
#include "qassert.h"
#include "qs_port.h"
#include "qs_pkg.h"

Go to the source code of this file.

Functions

void QS_test_pause_ (void)
 
uint32_t QS_getTestProbe_ (QSpyFunPtr const api)
 
Q_NORETURN Q_onAssert (char const *module, int_t location)
 
QSTimeCtr QS_onGetTime (void)
 
void QF_init (void)
 
void QF_stop (void)
 
int_t QF_run (void)
 
void QActive_start_ (QActive *const me, QPrioSpec const prioSpec, QEvt const **const qSto, uint_fast16_t const qLen, void *const stkSto, uint_fast16_t const stkSize, void const *const par)
 
void QActive_stop (QActive *const me)
 
void QTimeEvt_tick1_ (uint_fast8_t const tickRate, void const *const sender)
 
void QHsmDummy_ctor (QHsmDummy *const me)
 
void QHsmDummy_init_ (QHsm *const me, void const *const par, uint_fast8_t const qs_id)
 
void QHsmDummy_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 
void QActiveDummy_ctor (QActiveDummy *const me)
 
void QActiveDummy_init_ (QHsm *const me, void const *const par, uint_fast8_t const qs_id)
 
void QActiveDummy_dispatch_ (QHsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
 
void QActiveDummy_start_ (QActive *const me, QPrioSpec const prioSpec, QEvt const **const qSto, uint_fast16_t const qLen, void *const stkSto, uint_fast16_t const stkSize, void const *const par)
 
bool QActiveDummy_post_ (QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender)
 
void QActiveDummy_postLIFO_ (QActive *const me, QEvt const *const e)
 

Variables

struct QS_TestData QS_testData
 

Function Documentation

◆ QS_test_pause_()

void QS_test_pause_ ( void  )

internal function to pause test and enter the test event loop

Definition at line 68 of file qutest.c.

◆ QS_getTestProbe_()

uint32_t QS_getTestProbe_ ( QSpyFunPtr const  api)

get the test probe data for the given API

Definition at line 75 of file qutest.c.

◆ Q_onAssert()

Q_NORETURN Q_onAssert ( char const *  module,
int_t  location 
)

Callback function invoked in case of an assertion failure.

This callback function needs to be defined in the application to perform any corrective action after a non-recoverable error has been detected. 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.

Parameters
[in]modulename of the file/module in which the assertion failed (constant, zero-terminated C string)
[in]locationlocation of the assertion within the module. This could be a line number or a user-specified ID-number.
Returns
This callback function should not return (see Q_NORETURN), as continuation after an assertion failure does not make sense.
Note
During debugging, Q_onAssert() is an ideal place to put a breakpoint. For deployment, tt is typically a bad idea to implement Q_onAssert() as an endless loop that ties up the CPU (denial of service).

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

Definition at line 109 of file qutest.c.

◆ QS_onGetTime()

QSTimeCtr QS_onGetTime ( void  )

Definition at line 126 of file qutest.c.

◆ QF_init()

void QF_init ( void  )

Definition at line 171 of file qutest.c.

◆ QF_stop()

void QF_stop ( void  )

Definition at line 185 of file qutest.c.

◆ QF_run()

int_t QF_run ( void  )

Definition at line 190 of file qutest.c.

◆ QActive_start_()

void QActive_start_ ( QActive *const  me,
QPrioSpec const  prioSpec,
QEvt const **const  qSto,
uint_fast16_t const  qLen,
void *const  stkSto,
uint_fast16_t const  stkSize,
void const *const  par 
)

Definition at line 210 of file qutest.c.

◆ QActive_stop()

void QActive_stop ( QActive *const  me)

Definition at line 232 of file qutest.c.

◆ QTimeEvt_tick1_()

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

Definition at line 241 of file qutest.c.

◆ QHsmDummy_ctor()

void QHsmDummy_ctor ( QHsmDummy *const  me)

Definition at line 348 of file qutest.c.

◆ QHsmDummy_init_()

void QHsmDummy_init_ ( QHsm *const  me,
void const *const  par,
uint_fast8_t const  qs_id 
)

Definition at line 362 of file qutest.c.

◆ QHsmDummy_dispatch_()

void QHsmDummy_dispatch_ ( QHsm *const  me,
QEvt const *const  e,
uint_fast8_t const  qs_id 
)

Definition at line 385 of file qutest.c.

◆ QActiveDummy_ctor()

void QActiveDummy_ctor ( QActiveDummy *const  me)

Definition at line 402 of file qutest.c.

◆ QActiveDummy_init_()

void QActiveDummy_init_ ( QHsm *const  me,
void const *const  par,
uint_fast8_t const  qs_id 
)

Definition at line 420 of file qutest.c.

◆ QActiveDummy_dispatch_()

void QActiveDummy_dispatch_ ( QHsm *const  me,
QEvt const *const  e,
uint_fast8_t const  qs_id 
)

Definition at line 431 of file qutest.c.

◆ QActiveDummy_start_()

void QActiveDummy_start_ ( QActive *const  me,
QPrioSpec const  prioSpec,
QEvt const **const  qSto,
uint_fast16_t const  qLen,
void *const  stkSto,
uint_fast16_t const  stkSize,
void const *const  par 
)

Definition at line 442 of file qutest.c.

◆ QActiveDummy_post_()

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

Definition at line 469 of file qutest.c.

◆ QActiveDummy_postLIFO_()

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

Definition at line 527 of file qutest.c.

Variable Documentation

◆ QS_testData

struct QS_TestData QS_testData

QUTest data

Definition at line 65 of file qutest.c.