tests: prevent compiler warning when comparing floats
This commit is contained in:
parent
c5bc12f8cc
commit
df695c4933
7
tests.c
7
tests.c
@ -640,6 +640,11 @@ START_TEST(test_minmea_rescale)
|
|||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||||
|
/* The float values used in tests should be exactly representable under IEEE754;
|
||||||
|
* false negatives will occur otherwise. */
|
||||||
|
|
||||||
START_TEST(test_minmea_float)
|
START_TEST(test_minmea_float)
|
||||||
{
|
{
|
||||||
ck_assert(isnan(minmea_tofloat(&(struct minmea_float) { 42, 0 })));
|
ck_assert(isnan(minmea_tofloat(&(struct minmea_float) { 42, 0 })));
|
||||||
@ -658,6 +663,8 @@ START_TEST(test_minmea_coord)
|
|||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
Suite *minmea_suite(void)
|
Suite *minmea_suite(void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("minmea");
|
Suite *s = suite_create ("minmea");
|
||||||
|
Loading…
Reference in New Issue
Block a user