The Asserter class is used to throw exception or to report messages/failures to a TestResult.
More...
#include <robottestingframework/Asserter.h>
The Asserter class is used to throw exception or to report messages/failures to a TestResult.
- Note
- There are many usefull macros in the TestAssert.h which can be used to prepare detailed messages of errors or test failures.
Definition at line 47 of file Asserter.h.
◆ error() [1/2]
error Throw an error exception with the given message.
- Parameters
-
msg | The corresponding error message |
◆ error() [2/2]
static void robottestingframework::Asserter::error |
( |
bool |
condition, |
|
|
TestMessage |
msg |
|
) |
| |
|
static |
error Throw an error exception if the condition is not hold (it is not true).
- Parameters
-
condition | The boolean expression |
msg | The corresponding error message |
◆ fail() [1/2]
fail Throw a failure exception with the given message.
- Parameters
-
msg | The corresponding failure message |
◆ fail() [2/2]
static void robottestingframework::Asserter::fail |
( |
bool |
condition, |
|
|
TestMessage |
msg |
|
) |
| |
|
static |
fail Throw a failure exception if the condition is not hold (it is not true).
- Parameters
-
condition | The boolean expression |
msg | The corresponding failure message |
◆ format()
static std::string robottestingframework::Asserter::format |
( |
const char * |
msg, |
|
|
|
... |
|
) |
| |
|
static |
format can be used to format data to in the same way that sprintf
formats.
- Parameters
-
msg | a format-control string |
- Returns
- the formated std::string
- Examples:
- simple.cpp.
◆ report() [1/2]
report report a message to the result collector of the given TestSuite
- Parameters
-
msg | The corresponding message |
testsuite | The owner of the message (reporter) |
- Note
- report does not throw any exception!
◆ report() [2/2]
report report a message to the result collector of the given TestCase
- Parameters
-
msg | The corresponding message |
testcase | The owner of the message (reporter) |
- Note
- report does not throw any exception!
◆ testCheck()
static void robottestingframework::Asserter::testCheck |
( |
bool |
condition, |
|
|
TestMessage |
msg, |
|
|
TestCase * |
testcase |
|
) |
| |
|
static |
Checks the given boolean condition and if it is not hold (it is not true) a failure message will be added to the result collector; otherwise only the message will be reported.
- Parameters
-
condition | The boolean expression |
msg | The corresponding message |
testcase | The owner of the message (reporter) |
- Note
- This does not throw any exception!
◆ testFail()
static void robottestingframework::Asserter::testFail |
( |
bool |
condition, |
|
|
TestMessage |
msg, |
|
|
TestCase * |
testcase |
|
) |
| |
|
static |
Checks the given boolean condition and if it is not hold (it is not true) a failure message will be added to the result collector.
- Parameters
-
condition | The boolean expression |
msg | The corresponding message |
testcase | The owner of the message (reporter) |
- Note
- This does not throw any exception!
The documentation for this class was generated from the following file:
- src/robottestingframework/include/robottestingframework/Asserter.h