build warnings: calling abs() on floating point type
../tests/ntpdig/packet_handling.c:138:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(1.25, offset);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:138:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:139:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(1. / ULOGTOD(16), precision);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:139:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:141:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(1.125015, synch_distance);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:141:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:182:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(-1, offset);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:182:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:183:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(1. / ULOGTOD(1), precision);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:183:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:184:2: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
EXPECT_DOUBLE_EQ(1.3333483333333334, synch_distance);
^
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
../tests/ntpdig/packet_handling.c:184:2: note: use function 'fabs' instead
../tests/ntpdig/packet_handling.c:17:19: note: expanded from macro 'EXPECT_DOUBLE_EQ'
TEST_ASSERT_TRUE(abs(a - b) < max); \
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity.h:69:126: note: expanded from macro 'TEST_ASSERT_TRUE'
#define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE")
^
/Users/selsky/src/gitlab.com/ntpsec/tests/unity/unity_internals.h:577:102: note: expanded from macro 'UNITY_TEST_ASSERT'
#define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)line, message);}
^
6 warnings generated.
On osx 10.11.2 with xcode 7.1.1