提交 a6748f39 编写于 作者: J jsalling

Test number arrays comparison with length 0, it should fail

 Get test coverage on this feature for int, float, & double
上级 07513dd3
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册