|
HDK
|
Status maintainer used to run a test. More...
#include <UT_TestManager.h>
Public Types | |
| enum | InitEnum { OK, FAIL } |
Public Member Functions | |
| UT_TestUnit (const char *format,...) SYS_PRINTF_CHECK_ATTRIBUTE(2 | |
| UT_TestUnit (InitEnum init_enum, const char *format,...) SYS_PRINTF_CHECK_ATTRIBUTE(3 | |
| ~UT_TestUnit () | |
| bool | fail (const char *format=NULL,...) SYS_PRINTF_CHECK_ATTRIBUTE(2 |
| bool bool | ok (const char *format=NULL,...) SYS_PRINTF_CHECK_ATTRIBUTE(2 |
| bool bool void | restartTimer (const char *format=NULL,...) SYS_PRINTF_CHECK_ATTRIBUTE(2 |
| bool bool void void | setAlwaysPrint (bool f) |
| Enable printing of success/failure when this unit test is destroyed. More... | |
| bool | status () const |
| Query the status of the test. More... | |
| bool | getStatus () const |
| bool | setStatus (bool b) |
Status maintainer used to run a test.
This class simplifies the book-keeping when running a test. The unit test will automatically log information (i.e. performance, memory) if the UT_TestManager is so configured.
Example 1:
Example 2:
Definition at line 108 of file UT_TestManager.h.
| Enumerator | |
|---|---|
| OK | |
| FAIL | |
Definition at line 111 of file UT_TestManager.h.
| UT_TestUnit::UT_TestUnit | ( | const char * | format, |
| ... | |||
| ) |
| UT_TestUnit::UT_TestUnit | ( | InitEnum | init_enum, |
| const char * | format, | ||
| ... | |||
| ) |
| UT_TestUnit::~UT_TestUnit | ( | ) |
| bool UT_TestUnit::fail | ( | const char * | format = NULL, |
| ... | |||
| ) |
Print out the message given by a format. This includes the test name, and other information. No newline should be included in the format.
The function always returns false.
|
inline |
Definition at line 143 of file UT_TestManager.h.
| bool bool UT_TestUnit::ok | ( | const char * | format = NULL, |
| ... | |||
| ) |
Print out the message given by a format. This includes the test name, and other information. No newline should be included in the format.
The function always returns true.
| bool bool void UT_TestUnit::restartTimer | ( | const char * | format = NULL, |
| ... | |||
| ) |
Restart the timer. If format is non-NULL, then it will print the time as well from when the timer last started. Note that the timer is automatically started in the constructor.
Enable printing of success/failure when this unit test is destroyed.
Definition at line 139 of file UT_TestManager.h.
|
inline |
Definition at line 144 of file UT_TestManager.h.
|
inline |
Query the status of the test.
Definition at line 142 of file UT_TestManager.h.