mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-29 04:35:29 +03:00
Implement CHECK_ARRAY_CLOSE_DESCRIBED macro
This commit is contained in:
parent
9f0233266b
commit
9d0e5fc35d
3 changed files with 92 additions and 0 deletions
|
|
@ -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}};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue