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

Introduce fuzz tests for wrap_optimal_fit and wrap_first_fit #256

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

mgeisler
Copy link
Owner

@mgeisler mgeisler commented Dec 18, 2020

These fuzz tests immediately found the problem reported in #247 and gave a short way of reproducing it:

wrap("x y", 515566821223)

will currently panic due to an overflow error. This is because the gap after "x" is enourmous, large enough to make cost += gap * gap overflow the i32 type currently used for the cost computations.

The wrap_first_fit function seems to not crash.

Run the fuzz tests with:

$ cargo fuzz run fill_optimal_fit -- -only_ascii=1

You’ll need to cargo install cargo-fuzz first.

These fuzz tests immediately found the problem reported in #247 and
gave a short way of reproducing it:

    wrap("x y", 515566821223)

will currently panic due to an overflow error. The wrap_first_fit
function seems to not crash.

Run the fuzz tests with:

    $ cargo fuzz run fill_optimal_fit -- -only_ascii=1

You’ll need to `cargo install cargo-fuzz` first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant