Skip to content

Make BFHash take on non negative values only, issue #229 #243

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

Merged
merged 3 commits into from
Dec 13, 2013

Conversation

michael-natapov
Copy link
Contributor

No description provided.

… added scalacheck

that the new indices are non negative and a test for the problematic case
@michael-natapov
Copy link
Contributor Author

should remove seed variable to align with PR #220 (in the tests)

}

val negativeBFHash = NegativeBFHash(NUM_HASHES, WIDTH, SEED)
val bfHash = BFHash(NUM_HASHES, WIDTH, SEED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use scalacheck to generate these rather than being fixed magic values

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, ALSO have fixed magic values. These were found to have the bug, so let's keep them to prevent regression.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well for the Specification section rather than the scalacheck one we should try generate the exact problem case, not sure it would make any benefit here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test for the problem case in the Specification already.
I'll make the property generic with an arbitrary "negative" hash.

@ianoc
Copy link
Collaborator

ianoc commented Dec 9, 2013

Great to see a pull request on this, thanks! Just a few small things

johnynek added a commit that referenced this pull request Dec 13, 2013
Make BFHash take on non negative values only, issue #229
@johnynek johnynek merged commit 3fb7c17 into twitter:develop Dec 13, 2013
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.

3 participants