Home |
Getting Started |
Documentation |
Related Sites
Macros and defines in the customzing area have to be adapted for your hardware. The macros in the customzing area are used for hardware abstraction. You have to provide at least these functions for a minimal test system.
UCUNIT_MAX_TRACEPOINTS <max. number of tracepoints>
Max. number of tracepoints. This may depend on your application or limited by your RAM.
Verbose Mode.
UCUNIT_MODE_SILENT Checks are performed silently.
UCUNIT_MODE_NORMAL Only checks that fail are displayes
UCUNIT_MODE_VERBOSE Passed and failed checks are displayed
Encapsulates a function which is called for writing a message string to the host computer.
msg Message which shall be written.
- Note:
- Implement a function to write an integer to a host computer.
For most microcontrollers a special implementation of printf is available for writing to a serial device or network. In some cases you will have also to implement a putch(char c) function.
Encapsulates a function which is called for writing an integer to the host computer.
n Integer number which shall be written
- Note:
- Implement a function to write an integer to a host computer.
For most microcontrollers a special implementation of printf is available for writing to a serial device or network. In some cases you will have also to implement a putch(char c) function.
Encapsulates a function which is called for putting the hardware to a safe state.
- Note:
- Implement a function to put your hardware into a safe state.
For example, imagine a motor controller application: 1. Stop the motor 2. Power brake 3. Hold the brake 4. Switch warning lamp on 5. Wait for acknowledge ...
Encapsulates a function which is called for recovering the hardware from a safe state.
- Note:
- Implement a function to recover your hardware from a safe state.
For example, imagine our motor controller application: 1. Acknowledge the error with a key switch 2. Switch warning lamp off 3. Reboot ...
Encapsulates a function which is called for initializing the hardware.
- Note:
- Implement a function to initialize your microcontroller hardware. You need at least to initialize the communication device for transmitting your results to a host computer.
Encapsulates a function which is called to stop the tests if a checklist fails.
- Note:
- Implement a function to stop the execution of the tests.
Begin of a checklist. You have to tell what action shall be taken if a check fails.
action Action to take. This can be:
UCUNIT_ACTION_WARNING: A warning message will be printed that a check has failed
UCUNIT_ACTION_SHUTDOWN: The system will shutdown at the end of the checklist.
UCUNIT_ACTION_SAFESTATE: The system goes into the safe state on the first failed check.
- Note:
- A checklist must be finished with
UCUNIT_EndChecklist()
End of a checklist. If the action was UCUNIT_ACTION_SHUTDOWN the system will shutdown.
- Note:
- A checklist must begin with
UCUNIT_ChecklistBegin(action)
Checks a condition and prints a message.
msg Message to write.
args Argument list as string
- Note:
- Basic check. This macro is used by all higher level checks.
Checks that actual value equals the expected value.
expected Expected value. actual Actual value.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks that a pointer is NULL.
pointer Pointer to check.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks that a pointer is not NULL.
pointer Pointer to check.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a value is between lower and upper bounds (inclusive) Mathematical: lower <= value <= upper
value Value to check.
lower Lower bound.
upper Upper bound.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a value fits into 8-bit.
value Value to check.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a value fits into 16-bit.
value Value to check.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a value fits into 32-bit.
value Value to check.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a bit is set in value.
value Value to check.
bitno Bit number. The least significant bit is 0.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Checks if a bit is not set in value.
value Value to check.
bitno Bit number. The least significant bit is 0.
- Note:
- This macro uses UCUNIT_Check(condition, msg, args).
Marks the beginning of a test case and resets the test case statistic.
name Name of the test case.
- Note:
- This macro uses UCUNIT_WriteString(msg) to print the name.
Marks the end of a test case and calculates the test case statistics.
- Note:
- This macro uses UCUNIT_WriteString(msg) to print the result.
Marks a trace point. If a trace point is executed, its coverage state switches from 0 to the line number. If a trace point was never executed, the state remains 0.
index Index of the tracepoint.
- Note:
- This macro fails if index>UCUNIT_MAX_TRACEPOINTS.
Resets the trace point coverage state to 0.
index Index of the trace point.
- Note:
- This macro fails if index>UCUNIT_MAX_TRACEPOINTS.
Writes the test suite summary.
- Note:
- This macro uses UCUNIT_WriteString(msg) and UCUNIT_WriteInt(n) to write the summary.