Implement CHECK_ARRAY_CLOSE_DESCRIBED macro

This commit is contained in:
Erik Elfström 2015-08-20 17:08:29 +02:00
parent 9f0233266b
commit 9d0e5fc35d
3 changed files with 92 additions and 0 deletions

View file

@ -80,6 +80,13 @@ TEST(ArrayCloseSucceeds)
CHECK_ARRAY_CLOSE(a1, a2, 3, 0.1f);
}
TEST(CanUseCheckArrayCloseDescribedToGetCustomFailureMessage)
{
float const x[] = {1, 2.01f, 3};
float const expected[] = {1, 2, 3};
CHECK_ARRAY_CLOSE_DESCRIBED(expected, x, 3, 0.01f, "x is not correct, have you checked the flux capacitor?");
}
TEST(Array2dCloseSucceeds)
{
float const a1[][3] = {{1, 2, 3}, {4, 5, 6}};