#include "testcase.h"#include "testpartresult.h"Namespaces | |
| namespace | easyunit |
Classes | |
| class | easyunit::Test |
| Test class containing all macros to do unit testing. More... | |
Defines | |
| #define | EQUALS_DELTA(expected, actual, delta) (actual - expected) <= delta && actual >= expected || (expected - actual) <= delta && expected >= actual |
| #define | TO_STRING_EQUALS_F(expected, actual) StringFrom("Expected : ") + StringFrom(expected) + StringFrom(" but Actual : ") + StringFrom(actual) |
| #define | TO_STRING_EQUALS_S(expected, actual) StringFrom(expected) + StringFrom(" == ") + StringFrom(actual) |
| #define | TO_S_E_DELTA_F(expected, actual, delta) StringFrom("Expected : ") + StringFrom(expected) + StringFrom(" but Actual : ") + StringFrom(actual) + StringFrom(" with delta = ") + StringFrom(delta) |
| #define | TO_S_E_DELTA_S(expected, actual, delta) StringFrom(expected) + StringFrom(" == ") + StringFrom(actual) + StringFrom(" with delta = ") + StringFrom(delta) |
| #define | ASSERT_TRUE(condition) |
| Asserts that a condition is true. | |
| #define | ASSERT_TRUE_M(condition, message) |
| Asserts that a condition is true. | |
| #define | ASSERT_EQUALS(expected, actual) |
| Asserts that the two parameters are equals. | |
| #define | ASSERT_EQUALS_V(expected, actual) |
| Asserts that the two parameters are equals. | |
| #define | ASSERT_EQUALS_M(expected, actual, message) |
| Asserts that the two parameters are equals. | |
| #define | ASSERT_EQUALS_DELTA(expected, actual, delta) |
| Asserts that the two parameters are equals within a delta. | |
| #define | ASSERT_EQUALS_DELTA_M(expected, actual, delta, message) |
| Asserts that the two parameters are equals within a delta. | |
| #define | ASSERT_EQUALS_DELTA_V(expected, actual, delta) |
| Asserts that the two parameters are equals within a delta. | |
| #define | FAIL() { addTestPartResult(new TestPartResult(this, __FILE__, __LINE__,("Test failed."),failure)); return; } |
| Make a test fails. | |
| #define | FAIL_M(text) { addTestPartResult(new TestPartResult(this, __FILE__, __LINE__,text,failure)); return; } |
| Make a test fails with the given message. | |
| #define | TEST(testCaseName, testName) |
| Define a test in a TestCase. | |
| #define | TESTF(testCaseName, testName) |
| Define a test in a TestCase using test fixtures. | |
| #define | SETUP(testCaseName) void testCaseName##Declare##Test::setUp () |
| Setup code for test fixtures. | |
| #define | TEARDOWN(testCaseName) void testCaseName##Declare##Test::tearDown () |
| Teardown code for test fixtures. | |
| #define | DECLARE(testCaseName) |
| Location to declare variables and objets. | |
| #define | END_DECLARE }; |
| Ending macro used after DECLARE. | |
|
|
Value: Asserts that the two parameters are equals. Operator == must be defined. If the two parameters are not equals, a failure is generated.
|
|
|
Value: Asserts that the two parameters are equals within a delta. Operators == and - must be defined. If the two parameters are not equals, a failure is generated.
|
|
|
Value: Asserts that the two parameters are equals within a delta. Operators == and - must be defined. If the two parameters are not equals, a failure is generated.
|
|
|
Value: Asserts that the two parameters are equals within a delta. Operators == and - must be defined. If the two parameters are not equals, a failure is generated. Parameters must be primitive data types or StringFrom (custom type) must be overloaded.
|
|
|
Value: Asserts that the two parameters are equals. Operator == must be defined. If the two parameters are not equals, a failure is generated.
|
|
|
Value: Asserts that the two parameters are equals. Operator == must be defined. If the two parameters are not equals, a failure is generated. Parameters must be primitive data types or StringFrom (custom type) must be overloaded.
|
|
|
Value: Asserts that a condition is true. If the condition is not true, a failure is generated.
|
|
|
Value: Asserts that a condition is true. If the condition is not true, a failure is generated.
|
|
|
Value: Location to declare variables and objets. This is where user should declare members accessible by TESTF, SETUP and TEARDOWN. User should not use brackets after using this macro. User should not initialize any members here.
|
|
|
Ending macro used after DECLARE. User should use this macro after declaring members with DECLARE macro. |
|
|
|
|
|
Make a test fails.
|
|
|
Make a test fails with the given message.
|
|
|
Setup code for test fixtures. This code is executed before each TESTF. User should put his setup code between brackets after using this macro.
|
|
|
Teardown code for test fixtures. This code is executed after each TESTF. User should put his setup code between brackets after using this macro.
|
|
|
Value: Define a test in a TestCase. User should put his test code between brackets after using this macro.
|
|
|
Value: Define a test in a TestCase using test fixtures. User should put his test code between brackets after using this macro. This macro should only be used if test fixtures were declared earlier in this order: DECLARE, SETUP, TEARDOWN.
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.8