cmoon::test::assert_sequence_almost_equal
Defined in module
<cmoon.test>
|
(1) |
|
(2) |
Throws an assert_exception
if the two seqences are not almost equal.
Parameters
begin1 | - | Iterator to the beginning of the first sequence |
end1 | - | Iterator to end of the first sequence |
begin2 | - | Iterator to the beginning of the second sequence |
delta | - | Minimum difference to test between two objects |
r1 | - | First sequence |
r2 | - | Second sequence |
pred | - | Function called for comparison |
proj1 | - | Function to change an element of r1 before comparing |
proj2 | - | Function to change an element of r2 before comparing |
message | - | Extra information to be added to the error message |
location | - | Information about where in the file this assertion was ran |
Return value
(none)
Example
import <vector>;
import cmoon.test;
class example_test : public cmoon::test::test_case
{
public:
example_test()
: cmoon::test::test_case{"example test"} {}
void operator()() override
{
const std::vector<double> expected {1.0, 2.0, 3.0};
std::vector<double> values {1.0, 2.0, 3.0};
cmoon::test::assert_sequence_almost_equal(std::begin(values), std::end(values), std::begin(expected), 0.001);
cmoon::test::assert_sequence_almost_equal(values, expected, 0.001);
}
};