#include <test.h>
Public Member Functions | |
| Test (const SimpleString &testCaseName, const SimpleString &testName) | |
| Main Test constructor. | |
| virtual | ~Test () |
| Main Test desctructor Delete the testPartResult linked list. | |
| virtual void | tearDown () |
| Fixtures that will be called after run(). | |
| virtual void | setUp () |
| Fixtures that will be called before run(). | |
| virtual void | run () |
| Test code should be in this method. | |
| void | setTestCase (TestCase *testCase) |
| Set the TestCase this test belongs to. | |
| TestCase * | getTestCase () const |
| Get the TestCase this test belongs to. | |
| virtual void | addTestPartResult (TestPartResult *testPartResult) |
| Add a testpartresult to the testpartresult list of this test. | |
| TestPartResult * | getTestPartResult () const |
| Get the testpartresult list of this test. | |
| int | getFailuresCount () const |
| Returns number of failures found in this test. | |
| int | getSuccessesCount () const |
| Returns number of successes found in this test. | |
| int | getErrorsCount () const |
| Returns number of errors found in this test. | |
| void | setNext (Test *nextTest) |
| Set the next test in the linked list. | |
| Test * | getNext () const |
| Get the next test in the linked list. | |
| const SimpleString & | getTestCaseName () const |
| Get the name of the TestCase this test belongs to. | |
| const SimpleString & | getTestName () const |
| Get the name of this test. | |
Protected Attributes | |
| SimpleString | testCaseName_ |
| SimpleString | testName_ |
| TestCase * | testCase_ |
| TestPartResult * | testPartResult_ |
| Test * | nextTest_ |
| int | failuresCount_ |
| int | successesCount_ |
| int | errorsCount_ |
A test object represents a test that will be executed. Once it has been executed, it reports all results in the testPartResult linked list.
A failure occurs when a test fails (condition is false). An error occurs when an exception is thrown during a test. A success occurs if a test succeed (condition is true).
|
||||||||||||
|
Main Test constructor. Used to create a test that will register itself with TestRegistry and with its test case.
|
|
|
Main Test desctructor Delete the testPartResult linked list. This is why the user should only use the macro provided by easyunit to report a test result. |
|
|
Add a testpartresult to the testpartresult list of this test. This method is used by the assertion macros to report success, failure or error.
|
|
|
Returns number of errors found in this test. ErrorsCount <= 1, since exception are caught for the whole run() method.
|
|
|
Returns number of failures found in this test. If macro TEST or TESTF is used, failuresCount <= 1. If Test class is extended and ASSERT macros are used in different test methods, than failuresCount may be more than 1.
|
|
|
Get the next test in the linked list.
|
|
|
Returns number of successes found in this test. There may be more than one success since each ASSERT macro that succeeded generate a success.
|
|
|
Get the TestCase this test belongs to. A test always belongs to only one TestCase. This is the TestCase identified by the first parameter of the test declaration. For example, if there is a test declared as TEST(TESTCASE1, TEST1), this test will be associated with the TestCase TESTCASE1.
|
|
|
Get the name of the TestCase this test belongs to. The name of the TestCase is the first parameter of the test declaration. For example, if a test is declared as TEST(TESTCASE1, TEST1), this method will return "TESTCASE1".
|
|
|
Get the name of this test. The name of the test is the second parameter of the test declaration. For example, if a test is declared as TEST(TESTCASE1, TEST1), this method will return "TEST1".
|
|
|
Get the testpartresult list of this test. If assertion macros and TEST and TESTF macros are used, there may be more than one successful testpartresult and no more than one error or failure.
|
|
|
Test code should be in this method. run() will be called by the Test's TestCase, hence subclasses of Test should override this method. |
|
|
Set the next test in the linked list.
|
|
|
Set the TestCase this test belongs to.
|
|
|
Fixtures that will be called before run().
|
|
|
Fixtures that will be called after run().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.8