Add a `Field::compare` method
This adds a compare
method for a instance of Field
to compare itself to another one. I originally wanted to overload operator==
, but implemented a normal method in order to be able to pass a tolerance. The method should return true
only if the the two fields have the same number of blocks and these blocks have the same structure, and each field value are equal up to the absolute tolerance passed to the function.
This does the job for now, but we might want to look into using the boost manipulator boost::test_tools::per_element
in the test assertions. That would require the field to be implemented as a container with a forward iterator: beyond my C++ skills at the minute.
Merge request reports
Activity
- Resolved by Thibault Lestang
- Resolved by Chris Cantwell
@tlestang Can you have a quick look at these comments? Would be worth getting this merged as I think it could be useful for more robust testing of the operators.
@ccantwel I forgot about this one.. I'll have a look now.
added 15 commits
-
cc93cafa...142c6bd4 - 11 commits from branch
master
- 6e60a566 - Add a Field::compare with tolerance
- 782055e4 - Introduce field fixture for expected result
- 91e75a33 - Compare output field against expected solution
- 7e6b9f80 - Fail if abs difference is _larger_ than tol
Toggle commit list-
cc93cafa...142c6bd4 - 11 commits from branch
- Resolved by Thibault Lestang
added 1 commit
- 50542899 - fix: Pass template argument stateOut to Field constructor
mentioned in commit e83c7bc5