|
TTS v4.1.0
The Tiny Test System
|
Macros for performing sequence-wide checks. More...
Macros | |
| #define | TTS_ALL_ABSOLUTE_EQUAL(L, R, N, ...) |
| Checks that two sequences have the same size and that their elements are at most N apart. | |
| #define | TTS_ALL_EQUAL(L, R, ...) |
| Checks that two sequences have the same size and equal elements. | |
| #define | TTS_ALL_IEEE_EQUAL(L, R, ...) |
| Checks that two sequences have the same size and that their elements are 0 ULP apart, that is equal or both NaN. | |
| #define | TTS_ALL_RELATIVE_EQUAL(L, R, N, ...) |
| Checks that two sequences have the same size and that their elements are within a combined relative and absolute tolerance N. | |
| #define | TTS_ALL_ULP_EQUAL(L, R, N, ...) |
| Checks that two sequences have the same size and that their elements are at most N ULP apart. | |
| #define TTS_ALL_ABSOLUTE_EQUAL | ( | L, | |
| R, | |||
| N, | |||
| ... ) |
#include <tts/test/sequence.hpp>
Checks that two sequences have the same size and that their elements are at most N apart.
Measures each pair of elements with tts::absolute_check, as TTS_ABSOLUTE_EQUAL does.
| L,R | Sequences to compare, each with a size() member or a size found by argument-dependent lookup. |
| N | Largest distance accepted. |
| ... | REQUIRED ends the run when the check fails. |
| #define TTS_ALL_EQUAL | ( | L, | |
| R, | |||
| ... ) |
#include <tts/test/sequence.hpp>
Checks that two sequences have the same size and equal elements.
Compares the elements as TTS_ALL_ABSOLUTE_EQUAL does with N = 0.
| L,R | Sequences to compare, each with a size() member or a size found by argument-dependent lookup. |
| ... | REQUIRED ends the run when the check fails. |
| #define TTS_ALL_IEEE_EQUAL | ( | L, | |
| R, | |||
| ... ) |
#include <tts/test/sequence.hpp>
Checks that two sequences have the same size and that their elements are 0 ULP apart, that is equal or both NaN.
Compares the elements as TTS_ALL_ULP_EQUAL does with N = 0.
| L,R | Sequences to compare, each with a size() member or a size found by argument-dependent lookup. |
| ... | REQUIRED ends the run when the check fails. |
| #define TTS_ALL_RELATIVE_EQUAL | ( | L, | |
| R, | |||
| N, | |||
| ... ) |
#include <tts/test/sequence.hpp>
Checks that two sequences have the same size and that their elements are within a combined relative and absolute tolerance N.
Each pair of elements a and b passes if abs(a - b) <= N * max(1, abs(a), abs(b)), the combined tolerance test of tts::relative_check. N acts as an absolute tolerance where both values are at most 1 in magnitude, and as a relative one elsewhere. Two NaNs or two equal infinities pass, and any other NaN or infinity fails.
N is a ratio, so 0.005 accepts half a percent. On an arithmetic type, a finite N of 1 or more fails the check with a message asking for N divided by a hundred, since TTS 3 took a percentage.
| L,R | Sequences to compare, each with a size() member or a size found by argument-dependent lookup. |
| N | Tolerance, as a ratio. |
| ... | REQUIRED ends the run when the check fails. |
| #define TTS_ALL_ULP_EQUAL | ( | L, | |
| R, | |||
| N, | |||
| ... ) |
#include <tts/test/sequence.hpp>
Checks that two sequences have the same size and that their elements are at most N ULP apart.
Measures each pair of elements with tts::ulp_check, as TTS_ULP_EQUAL does.
| L,R | Sequences to compare, each with a size() member or a size found by argument-dependent lookup. |
| N | Largest distance accepted, in ULP. |
| ... | REQUIRED ends the run when the check fails. |