<div dir="ltr">Good morning/afternoon/evening all,<div><br></div><div>I've been lately trying to get subsurface tests to pass under windows. In the current state, TestParse and TestPreferences are the two ones still failing...</div><div><br></div><div>In short, the error raised by TestParse is caused by a rounding error when converting dm4 sample depth from float meters to int millimeters. The inconsistency was raised running the test on windows but same behavior can be seen on linux for certain float values too. Have a look at the changes in the pull request here for the details: <a href="https://github.com/Subsurface-divelog/subsurface/pull/233">https://github.com/Subsurface-divelog/subsurface/pull/233</a></div><div><br></div><div>The fix in itself is easy, surround the booean_value * 1000 with a rint: "rint(booean_value * 1000)" when it is assigned to the integer variable...</div><div><br></div><div>As I was commenting in the pull request, <span style="color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px">I have identified several other potential similar rounding issues. </span><span style="color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px">The exact same one in dm5_dive code, in maxdepth computation for both dm4_dive and dm5_dive and many other places in parse-xml.c code and some as well (but in lesser amount) in other parts of the code.</span></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px">The one fixed here is the only one that was highlighted by a test failure (when running TestParse on windows). How should we proceed forward?</p><ol style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px"><li style="box-sizing:border-box;margin-left:0px">My original goal was more to get all tests passing under windows so it could get integrated in CI, TestPreference is still failing... So we could simply pull this change and get back to this issue later, focusing first on test execution for windows CI.</li><li style="box-sizing:border-box;margin-top:0.25em;margin-left:0px">Fix "blindly" all potential rounding errors, but I'm not really clear on what could be the side effect(s) of this.</li><li style="box-sizing:border-box;margin-top:0.25em;margin-left:0px">Spend time creating test cases that would highlight each rounding errors but the task is huge, not always straight forward (blob data), and current test philosophy seem to be closer to quick functional testing rather than deep regression testing.</li></ol><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px;margin-bottom:0px">What is your point of view here?</p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px;margin-bottom:0px"><br></p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px;margin-bottom:0px">Best regards,</p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px;margin-bottom:0px"><br></p><p style="box-sizing:border-box;margin-top:0px;color:rgb(36,41,46);font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px;margin-bottom:0px">Jérémie</p></div>