Assert operator or ao |ei'ou| is a software to simplify multi-platform testing. The ao promotes the approach of isolating test data from testing code and as a consequence the ao test consists of assert operator cases.
An assert operator case is a test case consumed by the user-supplied assert_case()
function
that should return an assert operation as a result. The test case structure is usually defined by the aocase_t
type
and hence the recommended function declaration is aop_t assert_case(aocase_t *aoc)
.
An assert operation or aop |ei'ou'pi| i 672D s an assertion unit of the assert operator case and is one of the following:
- AOP_PASS - the assert operation is successful (always 0)
- AOP_FAIL - the assert operation is failed and by default the test stops immediatly and the remaining assert operations are not run
- AOP_SKIP - the assert operation is skipped and the test continues to run the remaining assert operations
To run an assert operation means to execute the assert_case()
function with a test case to determine its assertion unit, aop.
And during such exuction the assert operation can be violated by different factors
and this process is called assertion operation violation.
It is strongly recommended to assert operation violation as some can disrupt and even crash the system.
Currently, the following assertion operation violation can be caught:
- AOV_MEMV - Unexpected Memory Access
- AOV_PTRV - Unexpected Pointer Value
- AOV_RTMV - Unexpected Real Time Expiration
- AOV_UTMV - Unexpected User Time Expiration
- AOV_ETMV - Unexpected Execution Time Expiration
An easy way to assert time expiration is to use an according assert operator timer:
- AOT_RTM - Real Time
- AOT_UTM - User (Virtual) Time
- AOT_ETM - Execution (Profiling) Time
The assert operation, if complicated, can be subdivided into several assert operations and concatenated together as a final result using the most to less strict order: AOP_FAIL, AOP_SKIP and AOP_PASS. However, if the further computation is unnecessary or expensive then classical assertions should be used instead.
The plentiful functions provided are corporated the libaop
library consisting of the following modules:
ao
- functions to run assert operatoraop
- functions to assert operationsaopf
- functions to assert operations with the expected and actual arguments auto-formatting and optional formattingassert
- classical assertionsaov
- functions to assert operation violationaot
- functions to run assert operator times...
- *modules are to be added...
tar xzvf ao.tar.gz
cd ao
./ao.sh setup --verbose