gtester: Explicitly convert arguments of g_assert_cmpfloat()

Using g_assert_cmpfloat() with a float or double causes warnings on the
newest Clang version, because the macro internally promotes all values to
a long double, which Clang warns about. Casting explicitly removes the
warning.

Closes: #1377
This commit is contained in:
Philip Chimento 2018-06-21 00:20:55 -07:00
parent e004d5f397
commit 9e46b2ef11

View File

@ -64,7 +64,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'x'); \
} G_STMT_END
#define g_assert_cmpfloat(n1,cmp,n2) G_STMT_START { \
long double __n1 = (n1), __n2 = (n2); \
long double __n1 = (long double) (n1), __n2 = (long double) (n2); \
if (__n1 cmp __n2) ; else \
g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'f'); \