mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
Add missing example tests for CHECK_ARRAY_EQUALS and CHECK_ARRAY2D_CLOSE
This commit is contained in:
parent
a6cbdfcd69
commit
f0b4338b48
1 changed files with 14 additions and 0 deletions
|
|
@ -37,6 +37,13 @@ TEST(ValidCheckCloseSucceeds)
|
|||
CHECK_CLOSE(2.001f, 2.0f, 0.01f);
|
||||
}
|
||||
|
||||
TEST(ArrayEqualSucceeds)
|
||||
{
|
||||
int const a1[] = {1, 2, 3};
|
||||
int const a2[] = {1, 2, 3};
|
||||
CHECK_ARRAY_EQUAL(a1, a2, 3);
|
||||
}
|
||||
|
||||
TEST(ArrayCloseSucceeds)
|
||||
{
|
||||
float const a1[] = {1, 2, 3};
|
||||
|
|
@ -44,6 +51,13 @@ TEST(ArrayCloseSucceeds)
|
|||
CHECK_ARRAY_CLOSE(a1, a2, 3, 0.1f);
|
||||
}
|
||||
|
||||
TEST(Array2dCloseSucceeds)
|
||||
{
|
||||
float const a1[][3] = {{1, 2, 3}, {4, 5, 6}};
|
||||
float const a2[][3] = {{1, 2.01f, 3}, {4, 5.01, 6}};
|
||||
CHECK_ARRAY2D_CLOSE(a1, a2, 2, 3, 0.1f);
|
||||
}
|
||||
|
||||
#ifndef UNITTEST_NO_EXCEPTIONS
|
||||
|
||||
TEST(CheckThrowMacroSucceedsOnCorrectException)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue