Test number arrays comparison with length 0, it should fail

Get test coverage on this feature for int, float, & double
This commit is contained in:
jsalling
2016-05-03 20:14:30 -05:00
parent 07513dd331
commit a6748f39cd

View File

@ -1580,6 +1580,16 @@ void testNotEqualIntArrays3(void)
VERIFY_FAILS_END
}
void testNotEqualIntArraysLengthZero(void)
{
_UU32 p0[1] = {1};
_UU32 p1[1] = {1};
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_INT_ARRAY(p0, p1, 0);
VERIFY_FAILS_END
}
void testEqualPtrArrays(void)
{
char A = 1;
@ -3148,6 +3158,20 @@ void testNotEqualFloatArraysInf(void)
#endif
}
void testNotEqualFloatArraysLengthZero(void)
{
#ifdef UNITY_EXCLUDE_FLOAT
TEST_IGNORE();
#else
float p0[1] = {0.0f};
float p1[1] = {0.0f};
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 0);
VERIFY_FAILS_END
#endif
}
// ===================== THESE TEST WILL RUN IF YOUR CONFIG INCLUDES DOUBLE SUPPORT ==================
void testDoublesWithinDelta(void)
@ -3664,6 +3688,20 @@ void testNotEqualDoubleArraysInf(void)
#endif
}
void testNotEqualDoubleArraysLengthZero(void)
{
#ifdef UNITY_EXCLUDE_DOUBLE
TEST_IGNORE();
#else
double p0[1] = {0.0};
double p1[1] = {0.0};
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 0);
VERIFY_FAILS_END
#endif
}
void testThatDetailsCanBeHandleOneDetail(void)
{
#ifdef UNITY_EXCLUDE_DETAILS