-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix stress histogram test #505
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
Fix stress histogram test #505
Conversation
|
Starting build on |
|
My clang-format gives different results than Travis... |
test/stressHistogram.cxx
Outdated
| for ( unsigned int j = 0; j < ndim; ++j ) | ||
| { | ||
| equals &= fabs(x1[j] - x2[j]) < 1E-15; | ||
| if (value1 != value2) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why keep this equality but replaced the one for error[12]? Aren't both floating points?
Looking at the result, the changes proposed by Travis look correct/improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I though value was an integer from the output of my debug statements, but looking at the interface it is indeed floating point. I will update it.
|
|
I'm using version 4.0. |
|
How is the result different? If the file that Travis saw was clang-formatted with $ROOTSYS/.clang-format and clang-format 4.0 then there is a regression in clang-format that we need to understand. |
|
Yes, there is probably a bug, or the default configuration for something we don't set manually changed. |
We tried to set everything explicit. If you find out what it is, we ought to update the .clang-format. |
The test failed because of using x == y comparison with floating point numbers. This replaces it with a test with a small tolerance using AreEqualRel() from TMath.
ac575df to
7a35a34
Compare
|
Ok, for now I just manually applied the changes that clang-format wants. |
|
Starting build on |
|
Thanks @amadio : merged! |
Replace direct floating point comparison with
AreEqualRel()comparison with a tolerance.