- updated color handling by standardizing output

- cleaned up internal types
- added verbose float support when sprintf is available and desirable
- tested float array handling (and fixed a bug! woo!)

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@68 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
mvandervoord
2010-04-02 18:11:07 +00:00
parent 4fc9cf594a
commit 54a924571b
6 changed files with 194 additions and 86 deletions

View File

@ -1250,6 +1250,71 @@ void testNotEqualHEX8Arrays3(void)
VERIFY_FAILURE_WAS_CAUGHT
}
void testEqualFloatArrays(void)
{
float p0[] = {1.0, 8.0, 25.4, 0.123};
float p1[] = {1.0, 8.0, 25.4, 0.123};
float p2[] = {1.0, 8.0, 25.4, 0.2};
float p3[] = {1.0, 23.0, 25.0, 0.26};
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 1);
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p0, 4);
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4);
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p2, 3);
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p3, 1);
}
void testNotEqualFloatArrays1(void)
{
float p0[] = {1.0, 8.0, 25.4, 0.253};
float p1[] = {1.0, 8.0, 25.4, 0.252};
int failed;
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4);
EXPECT_ABORT_END
failed = Unity.CurrentTestFailed;
Unity.CurrentTestFailed = 0;
VERIFY_FAILURE_WAS_CAUGHT
}
void testNotEqualFloatArrays2(void)
{
float p0[] = {1.0, 8.0, 25.4, 0.253};
float p1[] = {2.0, 8.0, 25.4, 0.253};
int failed;
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4);
EXPECT_ABORT_END
failed = Unity.CurrentTestFailed;
Unity.CurrentTestFailed = 0;
VERIFY_FAILURE_WAS_CAUGHT
}
void testNotEqualFloatArrays3(void)
{
float p0[] = {1.0, 8.0, 25.4, 0.253};
float p1[] = {1.0, 8.0, 25.5, 0.253};
int failed;
EXPECT_ABORT_BEGIN
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4);
EXPECT_ABORT_END
failed = Unity.CurrentTestFailed;
Unity.CurrentTestFailed = 0;
VERIFY_FAILURE_WAS_CAUGHT
}
void testEqualMemoryArrays(void)
{
int p0[] = {1, 8, 987, -2};