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

Improve EVM intruction test #727

Closed
feliam opened this issue Feb 2, 2018 · 2 comments
Closed

Improve EVM intruction test #727

feliam opened this issue Feb 2, 2018 · 2 comments

Comments

@feliam
Copy link
Contributor

feliam commented Feb 2, 2018

Make tests for all intructions (not just some) https://github.com/trailofbits/manticore/tree/master/tests/EVM
Add symbolic tests where all the input state is symbolic in different ways.

@feliam
Copy link
Contributor Author

feliam commented Jul 31, 2018

Maybe like this?

def test_SDIV(self):
constraints, world, vm = self._make()
result = vm.SDIV(115792089237316182568066630936765703517573245936339743861833633745570447228928, 200867255532373784442745261542645325315275374222849104412672)
self.assertEqual(-64, result)
def test_SDIVS1(self):
constraints, world, vm = self._make()
xx = constraints.new_bitvec(256, name="x")
yy = constraints.new_bitvec(256, name="y")
constraints.add(xx == 0x20)
constraints.add(yy == 1)
result = vm.SDIV(xx, yy)
self.assertListEqual(solver.get_all_values(constraints, result), [0x20])

@disconnect3d
Copy link
Member

Closing this as I believe this is already done with VMTests and will be extended with GeneralStateTests (see #1163).

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

No branches or pull requests

2 participants