-
Notifications
You must be signed in to change notification settings - Fork 85
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
Unit tests for op functions #358
Conversation
…-vm into freesig/avoid-code-clone-2
…-vm into freesig/unit-test-call
Now have at least one unit test per op function. |
b175852
to
4ffd77b
Compare
a8bda42
to
5558f53
Compare
…into freesig/unit-test-all-op-fns
…t-test-all-op-fns
5558f53
to
2362071
Compare
pc: RegMut::new(&mut pc), | ||
}; | ||
let mut dest = 0; | ||
alu_capture_overflow(&mut dest, Reg::new(&flag), common, u128::overflowing_add, b, c) |
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.
I feel like we should consider wrapping add more fully into it's own fn, as this is basically a copy/paste of what add does rather than testing the same exact add logic used by the interpreter.
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.
Yeh but this is true for basically all the ops in alu. I guess the point is to more unit test the actual function alu_capture_overflow
Adds at least one unit test per op functions but some have full coverage.