|
Unit Test Framework C and Traditional C++ API Reference
|
Macros to help writing unit tests. More...
Macros | |
| #define | RTITest_fail(msg__) |
| Make a test fail with a given message. More... | |
| #define | RTITest_waitForConditionNoFailure(cond__, maxSeconds__) |
| Wait for a condition to be true. More... | |
| #define | RTITest_waitForConditionWithAction(cond__, maxSeconds__, action__) |
| Wait for a condition to be true. Otherwise, run the given action. More... | |
| #define | RTITest_waitForCondition(cond__, maxSeconds__) RTITest_waitForConditionEx(cond__, maxSeconds__, 0) |
| Wait for a condition to be true. More... | |
| #define | RTITest_waitForOk(retcode__, maxSeconds__) RTITest_waitForConditionEx((retcode__) == DDS_RETCODE_OK, (maxSeconds__), 0) |
| Wait for a DDS_ReturnCode_t return code to be DDS_RETCODE_OK. More... | |
| #define | RTITest_waitWhileConditionMatchWithAction(cond__, maxSeconds__, action__) |
| Wait while a condition is true for a given number of seconds. If the condition becomes false, run the given action. More... | |
| #define | RTITest_waitWhileConditionMatch(cond__, maxSeconds__) RTITest_waitWhileConditionMatchWithAction(cond__, maxSeconds__, goto done) |
| Wait while a condition is true for a given number of seconds. More... | |
| #define | RTITest_waitForGreaterThanInt(expected__, actual__, maxSeconds__) |
| Wait for a given integer to become greater than another one. More... | |
| #define | RTITest_waitForGreaterOrEqualsInt(expected__, actual__, maxSeconds__) |
| Wait for an integer to become equal to or greater than another one. More... | |
| #define | RTITest_waitForLessThanOrEqualsInt(expected__, actual__, maxSeconds__) |
| Wait for a given integer to become less than or equal to another one. More... | |
| #define | RTITest_waitForEqualsInt(expected__, actual__, maxSeconds__) |
| Wait for two given integers to become equal. More... | |
| #define | RTITest_waitForEqualsLong(expected__, actual__, maxSeconds__) |
| Wait for two given long integers to become equal. More... | |
| #define | RTITest_waitForEqualsLongLong(expected__, actual__, maxSeconds__) |
| Wait for two given long long integers to become equal. More... | |
| #define | RTITest_waitForGreaterThanLongLong(expected__, actual__, maxSeconds__) |
| Wait for a long long integer to become greater than another one. More... | |
| #define | RTITest_waitForEqualsUnsignedInt(expected__, actual__, maxSeconds__) |
| Wait for two given unsigned integers to become equal. More... | |
| #define | RTITest_waitForEqualsUnsignedLongLong(expected__, actual__, maxSeconds__) |
| Wait for two given unsigned long long integers to become equal. More... | |
| #define | RTITestTime_toMilliseconds(s__, msec__, time__) |
| Convert RTITestTime into seconds and milliseconds. More... | |
| #define | RTITestTime_toMicroseconds(s__, usec__, time__) |
| Convert RTITestTime into seconds and microseconds. More... | |
| #define | RTITestTime_toNanoseconds(s__, nsec__, time__) |
| Convert RTITestTime into seconds and nanoseconds. More... | |
| #define | RTITestTime_fromMilliseconds(time__, s__, msec__) |
| Convert seconds and milliseconds into RTITestTime. More... | |
| #define | RTITestTime_fromMicroseconds(time__, s__, usec__) |
| Convert seconds and microseconds into RTITestTime. More... | |
| #define | RTITestTime_fromNanoseconds(time__, s__, nsec__) |
| Convert seconds and nanoseconds into RTITestTime. More... | |
Macros to help writing unit tests.
| #define RTITest_fail | ( | msg__ | ) |
Make a test fail with a given message.
| msg__ | In. The message to be printed. |
Calls goto done if the assertion fails. Therefore, this macro requires a done label to be defined in the method that this assertion is called in.
| #define RTITest_waitForConditionNoFailure | ( | cond__, | |
| maxSeconds__ | |||
| ) |
Wait for a condition to be true.
| cond__ | The condition to wait for. |
| maxSeconds__ | The maximum number of seconds to wait. |
| #define RTITest_waitForConditionWithAction | ( | cond__, | |
| maxSeconds__, | |||
| action__ | |||
| ) |
Wait for a condition to be true. Otherwise, run the given action.
| cond__ | The condition to wait for. |
| maxSeconds__ | The maximum number of seconds to wait. |
| action__ | The action to run if the condition is not true. |
| #define RTITest_waitForCondition | ( | cond__, | |
| maxSeconds__ | |||
| ) | RTITest_waitForConditionEx(cond__, maxSeconds__, 0) |
Wait for a condition to be true.
| cond__ | The condition to wait for. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForOk | ( | retcode__, | |
| maxSeconds__ | |||
| ) | RTITest_waitForConditionEx((retcode__) == DDS_RETCODE_OK, (maxSeconds__), 0) |
Wait for a DDS_ReturnCode_t return code to be DDS_RETCODE_OK.
| retcode__ | The DDS_ReturnCode_t code to wait for. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitWhileConditionMatchWithAction | ( | cond__, | |
| maxSeconds__, | |||
| action__ | |||
| ) |
Wait while a condition is true for a given number of seconds. If the condition becomes false, run the given action.
| cond__ | Wait while this condition is true. |
| maxSeconds__ | The maximum number of seconds to wait. |
| action__ | The action to run if the condition becomes false. |
| #define RTITest_waitWhileConditionMatch | ( | cond__, | |
| maxSeconds__ | |||
| ) | RTITest_waitWhileConditionMatchWithAction(cond__, maxSeconds__, goto done) |
Wait while a condition is true for a given number of seconds.
| cond__ | Wait while this condition is true. |
| maxSeconds__ | The maximum number of seconds to wait. |
| #define RTITest_waitForGreaterThanInt | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for a given integer to become greater than another one.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForGreaterOrEqualsInt | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for an integer to become equal to or greater than another one.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForLessThanOrEqualsInt | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for a given integer to become less than or equal to another one.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForEqualsInt | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for two given integers to become equal.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForEqualsLong | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for two given long integers to become equal.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForEqualsLongLong | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for two given long long integers to become equal.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForGreaterThanLongLong | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for a long long integer to become greater than another one.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForEqualsUnsignedInt | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for two given unsigned integers to become equal.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITest_waitForEqualsUnsignedLongLong | ( | expected__, | |
| actual__, | |||
| maxSeconds__ | |||
| ) |
Wait for two given unsigned long long integers to become equal.
| expected__ | The expected value. |
| actual__ | The actual value. |
| maxSeconds__ | The maximum number of seconds to wait. |
Calls goto done if the condition is never met. Therefore, this macro requires a done label to be defined in the method that this macro is called in.
| #define RTITestTime_toMilliseconds | ( | s__, | |
| msec__, | |||
| time__ | |||
| ) |
Convert RTITestTime into seconds and milliseconds.
| s__ | Out. The seconds field of the RTITestTime. |
| msec__ | Out. The fraction of the RTITestTime expressed in milliseconds. |
| time__ | In. The input RTITestTime. |
| #define RTITestTime_toMicroseconds | ( | s__, | |
| usec__, | |||
| time__ | |||
| ) |
Convert RTITestTime into seconds and microseconds.
| s__ | Out. The seconds field of the RTITestTime. |
| usec__ | Out. The fraction of the RTITestTime expressed in microseconds. |
| time__ | In. The input RTITestTime. |
| #define RTITestTime_toNanoseconds | ( | s__, | |
| nsec__, | |||
| time__ | |||
| ) |
Convert RTITestTime into seconds and nanoseconds.
| s__ | Out. The seconds field of the RTITestTime. |
| nsec__ | Out. The fraction of the RTITestTime expressed in nanoseconds. |
| time__ | In. The input RTITestTime. |
| #define RTITestTime_fromMilliseconds | ( | time__, | |
| s__, | |||
| msec__ | |||
| ) |
Convert seconds and milliseconds into RTITestTime.
| time__ | Out. The output RTITestTime. |
| s__ | In. The amount of seconds. |
| msec__ | In. The amount of milliseconds. |
| #define RTITestTime_fromMicroseconds | ( | time__, | |
| s__, | |||
| usec__ | |||
| ) |
Convert seconds and microseconds into RTITestTime.
| time__ | Out. The output RTITestTime. |
| s__ | In. The amount of seconds. |
| usec__ | In. The amount of microseconds. |
| #define RTITestTime_fromNanoseconds | ( | time__, | |
| s__, | |||
| nsec__ | |||
| ) |
Convert seconds and nanoseconds into RTITestTime.
| time__ | Out. The output RTITestTime. |
| s__ | In. The amount of seconds. |
| nsec__ | In. The amount of nanoseconds. |