Claudenw commented on code in PR #331:
URL:
https://github.com/apache/commons-collections/pull/331#discussion_r958608258
##########
src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java:
##########
@@ -93,16 +94,30 @@ protected final Shape getTestShape() {
*
*/
@Test
- public void testConstructWithBadHasher() {
+ public void testMergeWithBadHasher() {
// value too large
+ final BloomFilter f = createEmptyFilter(getTestShape());
assertThrows(IllegalArgumentException.class,
- () -> createFilter(getTestShape(), new
BadHasher(getTestShape().getNumberOfBits())));
+ () -> f.merge(new
BadHasher(getTestShape().getNumberOfBits())));
// negative value
- assertThrows(IllegalArgumentException.class, () ->
createFilter(getTestShape(), new BadHasher(-1)));
+ BloomFilter f2 = createEmptyFilter(getTestShape());
+ assertThrows(IllegalArgumentException.class, () -> f2.merge(new
BadHasher(-1)));
}
@Test
- public void testConstructWitBitMapProducer() {
+ public void testMergeWithHasher() {
+ // value too large
+ final BloomFilter f = createEmptyFilter(getTestShape());
+ f.merge(from1);
+ int[] idx = f.asIndexArray();
+ assertEquals(getTestShape().getNumberOfHashFunctions(), idx.length);
+ for (int i=0; i<idx.length; i++) {
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]