Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL: modcc unit test fails #1245

Closed
brenthuisman opened this issue Nov 17, 2020 · 0 comments · Fixed by #1246
Closed

WSL: modcc unit test fails #1245

brenthuisman opened this issue Nov 17, 2020 · 0 comments · Fixed by #1246

Comments

@brenthuisman
Copy link
Contributor

brenthuisman commented Nov 17, 2020

Running the modcc unit tests on a Win10+WSL+Ubuntu 20.04 build has 1 test failing (all other tests are OK):

/home/user/arbor/test/unit-modcc/test_parser.cpp:663: Failure
The difference between eval(e.get()) and test_case.second is 7.4505805969238281e-09, which exceeds 1e-10, where
eval(e.get()) evaluates to -63281459.031249993,
test_case.second evaluates to -63281459.03125, and
1e-10 evaluates to 1e-10.

A bug has been filed in the WSL repo: microsoft/WSL#830. long double is assumed to be 80 bit, but is 64 bit in WSL.

Since as of today WSL still installs v1 rather than v2 by default, and this is a minor bug, we can change the test to a relative error, e.g.:
EXPECT_TRUE(near_relative(eval(e.get()), test_case.second, 1e-10));
We can instead not assume assumptions about long double, and change eval() accordingly.

bcumming pushed a commit that referenced this issue Nov 19, 2020
Change from long double to double for storing floating point values in modcc.

WSL, and Windows generally, treats long double differently than Linux, which leads to inconsistencies in literal numeric values in code generated by modcc on the two platforms.

Fixes #1245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant