mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-25 09:21:36 +01:00
Merge pull request #215 from jsalling/bugfix/inf-equals-inf
Bugfix Inf equals Inf
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
[Released under MIT License. Please refer to license.txt for details]
|
||||
========================================== */
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "unity.h"
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
|
||||
// Dividing by these constants produces +/- infinity.
|
||||
@@ -2852,14 +2852,12 @@ void testFloatsNotEqualExpectedInf(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testFloatsNotEqualBothInf(void)
|
||||
void testFloatsEqualBothInf(void)
|
||||
{
|
||||
#ifdef UNITY_EXCLUDE_FLOAT
|
||||
TEST_IGNORE();
|
||||
#else
|
||||
EXPECT_ABORT_BEGIN
|
||||
TEST_ASSERT_EQUAL_FLOAT(1.0f / f_zero, 1.0f / f_zero);
|
||||
VERIFY_FAILS_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3208,7 +3206,7 @@ void testNotEqualFloatArraysNaN(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testNotEqualFloatArraysInf(void)
|
||||
void testEqualFloatArraysInf(void)
|
||||
{
|
||||
#ifdef UNITY_EXCLUDE_FLOAT
|
||||
TEST_IGNORE();
|
||||
@@ -3216,9 +3214,7 @@ void testNotEqualFloatArraysInf(void)
|
||||
float p0[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f};
|
||||
float p1[] = {1.0f, 1.0f / f_zero, 25.4f, 0.253f};
|
||||
|
||||
EXPECT_ABORT_BEGIN
|
||||
TEST_ASSERT_EQUAL_FLOAT_ARRAY(p0, p1, 4);
|
||||
VERIFY_FAILS_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3384,14 +3380,12 @@ void testDoublesNotEqualExpectedInf(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testDoublesNotEqualBothInf(void)
|
||||
void testDoublesEqualBothInf(void)
|
||||
{
|
||||
#ifdef UNITY_EXCLUDE_DOUBLE
|
||||
TEST_IGNORE();
|
||||
#else
|
||||
EXPECT_ABORT_BEGIN
|
||||
TEST_ASSERT_EQUAL_DOUBLE(1.0 / d_zero, 1.0 / d_zero);
|
||||
VERIFY_FAILS_END
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3739,7 +3733,7 @@ void testNotEqualDoubleArraysNaN(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testNotEqualDoubleArraysInf(void)
|
||||
void testEqualDoubleArraysInf(void)
|
||||
{
|
||||
#ifdef UNITY_EXCLUDE_DOUBLE
|
||||
TEST_IGNORE();
|
||||
@@ -3747,9 +3741,7 @@ void testNotEqualDoubleArraysInf(void)
|
||||
double p0[] = {1.0, 1.0 / d_zero, 25.4, 0.253};
|
||||
double p1[] = {1.0, 1.0 / d_zero, 25.4, 0.253};
|
||||
|
||||
EXPECT_ABORT_BEGIN
|
||||
TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4);
|
||||
VERIFY_FAILS_END
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user