Apps     Components     Interfaces     All Files     Source Tree     source: interfaces.Assert.nc

Interface: Assert

Expression verification. Using the assert() macro, verification of the current system state can be built-in. This enabled run-time errors to be logged to the console containing info such as file name and line number. Example code: assert(call Module.cmd() == SUCCESS); Example output: assert(call Module.cmd() == SUCCESS) failed at ModuleM.nc:42

Components providing this interface:
lib.LogC
lib.LogM
lib.TestM

Components requiring this interface:
apps.TestDirectD.TestDirectDM
apps.TestSuite.TestCacheM
apps.TestSuite.TestConstantSensorM
apps.TestSuite.TestNodeConfigM
apps.TestSuite.TestNodeListM
apps.TestSuite.TestSPIM
apps.TestSuite.TestTestM
apps.TestSuite.TestTimestampM
lib.DirectDC
lib.DirectDM

Commands

Commands - Details

failed

void failed(const char *errmsg, const char *file, uint16_t line)

Report assertion failure Normally the error message parameter will be the stringified expression being asserted.

Parameters:

errmsg - Error message, e.g. the stringified expression

file - Name of the file in which the assertion failed

line - Name of the line where the assertion failed