libcheck / check

A unit testing framework for C
GNU Lesser General Public License v2.1
1.08k stars 210 forks source link

Fix expected results for floating point tests to work on mingw32 #259

Open brarcher opened 4 years ago

brarcher commented 4 years ago

The string representations for a few floating point values differ on some Windows-based builds vs Linux. Some differences are listed here:

https://devblogs.microsoft.com/oldnewthing/20130221-00/?p=5183

One system that has this difference is MSVC using Visual Studios 2019. Building on 2017 works. An example failure building against 2019 is:

D:\a\check\check\tests\check_check_master.c:554:F:Core Tests:test_check_failure_msgs:0: For test 67:Simple Tests:test_ck_assert_float_finite Expected 'Assertion 'x is finite' failed: x == inf', got 'Assertion 'x is finite' failed: x == 1.#INF'

This was found using Github's Actions. To enable the Mingw32 unit testing this needs to be resolved.