-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Bug-Candidate]: ABDKMath64x64PropertyTests.sol: Tests output false negatives #13
Comments
Hey, thanks for your submission! |
Hey @beber89, sorry for the delay. I ran some tests on this issue, thanks again for bringing it up. The way that the Your PR addresses a condition that we weren't directly checking, that is overflow. I mean "directly" in the sense that if those functions were to overflow, the issue would be quite probably detected by the other failing tests that you mentioned in your report ( Another point is that even if the math tests are now tailored to ABDKMath64x64, they are meant to be reusable for other libraries too. So we shouldn't assume that all libraries will implement overflow checks the same way, tests should be created for them. I think the overflow test you implemented can be useful in the cases where the valid result range is different than the underlying type range (for example, a 32x32 fixed point lib implemented with So, in summary, I think we can add your suggestions to the repo as a new overflow test. Before defining how it should be implemented, I'd like to read your opinion on this @ggrieco-tob. |
Hey @glarregay-tob , sorry for all that time it took me to respond. I wrote that test based on the fact that the require statement applied on But I got your point now, I understand that the pull request which I am suggesting looks like it tests a different thing. It can be a general overflow/underflow test but not a range test. I had another idea also then but it still contradicts the purpose of the test I think as this one.
|
Describe the issue:
These 2 tests:
They are not actually showing failure in case
this.add
/this.sub
overflow or underflow.It looks like
result
being int128 makes it always conforming with the assert statement despite the failure inthis.add
/this.sub
.Steps to reproduce the issue:
Working directory:
tests/ABDKMath64x64PropertyTests/hardhat
Force
ABDKMath64x64
to overflow/underflow by commenting out the require statement on the tested methods.Run
echidna-test . --contract CryticABDKMath64x64Harness --test-mode assertion
Output:
add_test_range
andsub_test_range
did not fail as expected.If additional code is needed for reproducing, please copy it here, or drop us a link to the repository:
No response
Echidna version:
Echidna 2.0.1
Additional information:
No response
The text was updated successfully, but these errors were encountered: