Skip to content

Commit d7dc520

Browse files
committed
Rename FilterType -> TestFilterType to avoid having the same class twice
1 parent 6abdf42 commit d7dc520

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

fastfilter/src/test/java/org/fastfilter/RegressionTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.junit.runner.RunWith;
66
import org.junit.runners.Parameterized;
77

8-
import static org.fastfilter.FilterType.*;
8+
import static org.fastfilter.TestFilterType.*;
99
import static org.junit.Assert.assertTrue;
1010

1111
@RunWith(Parameterized.class)
@@ -57,12 +57,12 @@ public static Object[][] regressionCases() {
5757
};
5858
}
5959

60-
private final FilterType type;
60+
private final TestFilterType type;
6161
private final long seed;
6262
private final long[] keys;
6363
private final int bitsPerKey;
6464

65-
public RegressionTests(FilterType type, long seed, long[] keys, int bitsPerKey) {
65+
public RegressionTests(TestFilterType type, long seed, long[] keys, int bitsPerKey) {
6666
this.type = type;
6767
this.seed = seed;
6868
this.keys = keys;

fastfilter/src/test/java/org/fastfilter/SimpleFuzzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.stream.LongStream;
99

1010
import static junit.framework.TestCase.assertTrue;
11-
import static org.fastfilter.FilterType.*;
11+
import static org.fastfilter.TestFilterType.*;
1212

1313
public class SimpleFuzzer {
1414

@@ -17,7 +17,7 @@ public static void main(String... args) {
1717
for (int bitsPerKey = 8; bitsPerKey < 32; bitsPerKey += 8) {
1818
for (int keyLength = 3; keyLength < 1_000_000; keyLength += ThreadLocalRandom.current().nextInt(10000)) {
1919
long[] keys = LongStream.range(0, keyLength).map(i -> ThreadLocalRandom.current().nextLong()).toArray();
20-
for (FilterType type : FilterType.values()) {
20+
for (TestFilterType type : TestFilterType.values()) {
2121
try {
2222
for (int i = 0; i < 1_000_000; ++i) {
2323
seed = ThreadLocalRandom.current().nextLong();

fastfilter/src/test/java/org/fastfilter/TestAllFilters.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static org.junit.Assert.assertEquals;
44

55
import org.fastfilter.Filter;
6-
import org.fastfilter.FilterType;
6+
import org.fastfilter.TestFilterType;
77
import org.fastfilter.utils.Hash;
88
import org.fastfilter.utils.RandomGenerator;
99
import org.junit.Test;
@@ -90,11 +90,11 @@ public static void main(String... args) {
9090
for (int size = 1_000_000; size <= 10_000_000; size *= 10) {
9191
System.out.println("size " + size);
9292
for (int test = 0; test < 10; test++) {
93-
test(FilterType.BLOOM, size, test, true);
94-
test(FilterType.BLOCKED_BLOOM, size, test, true);
95-
test(FilterType.COUNTING_BLOOM, size, test, true);
96-
test(FilterType.SUCCINCT_COUNTING_BLOOM, size, test, true);
97-
test(FilterType.SUCCINCT_COUNTING_BLOOM_RANKED, size, test, true);
93+
test(TestFilterType.BLOOM, size, test, true);
94+
test(TestFilterType.BLOCKED_BLOOM, size, test, true);
95+
test(TestFilterType.COUNTING_BLOOM, size, test, true);
96+
test(TestFilterType.SUCCINCT_COUNTING_BLOOM, size, test, true);
97+
test(TestFilterType.SUCCINCT_COUNTING_BLOOM_RANKED, size, test, true);
9898
}
9999
}
100100

@@ -118,12 +118,12 @@ public void test() {
118118
}
119119

120120
private static void testAll(int len, boolean log) {
121-
for (FilterType type : FilterType.values()) {
121+
for (TestFilterType type : TestFilterType.values()) {
122122
test(type, len, 0, log);
123123
}
124124
}
125125

126-
private static void test(FilterType type, int len, int seed, boolean log) {
126+
private static void test(TestFilterType type, int len, int seed, boolean log) {
127127
long[] list = new long[len * 2];
128128
RandomGenerator.createRandomUniqueListFast(list, len + seed);
129129
long[] keys = new long[len];

fastfilter/src/test/java/org/fastfilter/TestFilterType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* The list of supported approximate membership implementations.
2121
*/
22-
public enum FilterType {
22+
public enum TestFilterType {
2323
BLOOM {
2424
@Override
2525
public Filter construct(long[] keys, int setting) {

jmh/src/main/java/org/fastfilter/ConstructionState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public class ConstructionState {
2828
"CUCKOO_PLUS_8",
2929
"CUCKOO_PLUS_16",
3030
"GCS"})
31-
FilterType type;
31+
TestFilterType type;
3232

3333
long[] keys;
3434

3535
public long[] getKeys() {
3636
return keys;
3737
}
3838

39-
public FilterType getConstructor() {
39+
public TestFilterType getConstructor() {
4040
return type;
4141
}
4242

0 commit comments

Comments
 (0)