File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
fastfilter/src/test/java/org/fastfilter Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .fastfilter ;
2+
3+ import org .fastfilter .utils .Hash ;
4+ import org .junit .Test ;
5+
6+ import java .util .concurrent .ThreadLocalRandom ;
7+
8+ import static junit .framework .TestCase .assertTrue ;
9+
10+ public class SimpleFuzzer {
11+
12+
13+ @ Test
14+ public void fuzzTest () {
15+ long [] keys = new long []{ 1 , 2 , 3 };
16+ long seed = 0 ;
17+
18+ for (FilterType type : FilterType .values ()) {
19+ try {
20+ for (int i = 0 ; i < 1000_000 ; ++i ) {
21+ seed = ThreadLocalRandom .current ().nextLong ();
22+ Hash .setSeed (seed );
23+ Filter filter = type .construct (keys , 8 );
24+ assertTrue (filter .mayContain (1 ));
25+ assertTrue (filter .mayContain (2 ));
26+ assertTrue (filter .mayContain (3 ));
27+ }
28+ } catch (Exception e ) {
29+ System .out .println (seed + "/" + type );
30+ throw e ;
31+ }
32+ }
33+ }
34+ }
Original file line number Diff line number Diff line change 1+ package org .fastfilter .bloom .count ;
2+
3+ import org .fastfilter .utils .Hash ;
4+ import org .junit .Test ;
5+
6+ import static org .junit .Assert .*;
7+
8+ public class SuccinctCountingBlockedBloomTest {
9+
10+ @ Test
11+ public void indexOutOfBoundsRegression () {
12+ long seed = 6049486880293779298L ;
13+ long [] keys = new long []{1 , 2 , 3 };
14+ Hash .setSeed (seed );
15+ SuccinctCountingBlockedBloom filter = SuccinctCountingBlockedBloom .construct (keys , 8 );
16+ assertTrue (filter .mayContain (1 ));
17+ assertTrue (filter .mayContain (2 ));
18+ assertTrue (filter .mayContain (3 ));
19+ }
20+
21+ }
You can’t perform that action at this time.
0 commit comments