I have two vectors:
std::vector<double> calculatedValues = calculateValues();
std::vector<double> expectedValues = {1.1, 1.2};
I am using cpputest to verify if these vectors are equal:
CHECK_TRUE(calculatedValues == expectedValues)
This is working. However, I am wondering whether I shouldn't use some tolerance, because after all I am comparing doubles.
To compare floating point values you should do something like this:
You can adapt it to compare your vectors.