Add missing example tests for CHECK_ARRAY_EQUALS and CHECK_ARRAY2D_CLOSE

This commit is contained in:
Erik Elfström 2015-08-21 08:45:10 +02:00
parent a6cbdfcd69
commit f0b4338b48

View file

@ -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)