|
Celeritas 0.7-develop+ddcb429
|
Compare selected container fields of two reference-result objects and accumulate whether all comparisons succeed. More...
#include <RefComparer.hh>
Public Member Functions | |
| RefComparer (AssertionHelper &helper, T const &expected, T const &actual) | |
| Create a comparer for two results and an assertion helper. | |
| template<class M > | |
| bool | is_soft_eq (char const *attr, M T::*member) |
| Compare a member container using the default soft comparator. | |
| template<class M , class Tol > | |
| bool | is_soft_eq (char const *attr, M T::*member, Tol &&tol) |
| Compare a member container using an explicit soft-comparison tolerance. | |
| template<class M > | |
| bool | is_eq (char const *attr, M T::*member) |
| Compare a member container using exact element equality. | |
| void | record_result (bool success) |
| Add a custom comparison result to the aggregate status. | |
| operator bool () const | |
| Whether all comparisons made by this comparer succeeded. | |
Compare selected container fields of two reference-result objects and accumulate whether all comparisons succeed.
The comparer stores references to the assertion helper and the expected and actual objects. Each comparison method takes a pointer to a member of the result type; the attribute name is used to identify failures in the assertion output. Exact comparison checks container elements for equality, while soft comparison uses the default soft comparator or a caller-supplied tolerance. The result of each comparison is also added to the aggregate status, which can be queried with the explicit bool conversion.
Typically CELER_INVOKE_ATTR is used to reduce duplication.