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

Unit tests for op functions #358

Merged
merged 44 commits into from
Mar 3, 2023
Merged

Unit tests for op functions #358

merged 44 commits into from
Mar 3, 2023

Conversation

freesig
Copy link
Contributor

@freesig freesig commented Feb 20, 2023

Adds at least one unit test per op functions but some have full coverage.

@freesig freesig added testing fuel-vm Related to the `fuel-vm` crate. labels Feb 20, 2023
@freesig freesig self-assigned this Feb 20, 2023
@freesig
Copy link
Contributor Author

freesig commented Feb 22, 2023

Now have at least one unit test per op function.

@freesig freesig force-pushed the freesig/unit-tests-for-op-fns branch from 5558f53 to 2362071 Compare March 1, 2023 03:12
@freesig freesig marked this pull request as ready for review March 1, 2023 03:13
@freesig freesig requested a review from a team March 1, 2023 03:13
pc: RegMut::new(&mut pc),
};
let mut dest = 0;
alu_capture_overflow(&mut dest, Reg::new(&flag), common, u128::overflowing_add, b, c)
Copy link
Member

@Voxelot Voxelot Mar 1, 2023

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.

Copy link
Contributor Author

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

Base automatically changed from freesig/unit-test-all-op-fns to master March 1, 2023 05:28
@freesig freesig merged commit 4bb22e1 into master Mar 3, 2023
@freesig freesig deleted the freesig/unit-tests-for-op-fns branch March 3, 2023 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuel-vm Related to the `fuel-vm` crate. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants