Skip to content

Commit

Permalink
It turns out that the MurmurHash3v2Test.java file was the ONLY file in
Browse files Browse the repository at this point in the history
the datasketches-java repo that had blank lines with extra spaces.

So I piggy-backed it here to avoid another PR.
  • Loading branch information
leerho committed Feb 16, 2022
1 parent 7cebe0b commit 7c2c57d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
42 changes: 21 additions & 21 deletions src/test/java/org/apache/datasketches/hash/MurmurHash3v2Test.java
Expand Up @@ -38,7 +38,7 @@
public class MurmurHash3v2Test {
private Random rand = new Random();
private static final int trials = 1 << 20;

@Test
public void compareLongArrLong() { //long[]
int arrLen = 3;
Expand All @@ -54,7 +54,7 @@ public void compareLongArrLong() { //long[]
assertEquals(res2, res1);
}
}

@Test
public void compareIntArr() { //int[]
int bytes = Integer.BYTES;
Expand All @@ -63,7 +63,7 @@ public void compareIntArr() { //int[]
int iPer = 8 / bytes;
int nLongs = arrLen / iPer;
int shift = 64 / iPer;

for (int i = 0; i < trials; i++) { //trials
for (int j = 0; j < nLongs; j++) { //longs
long r = rand.nextLong();
Expand All @@ -77,7 +77,7 @@ public void compareIntArr() { //int[]
assertEquals(res2, res1);
}
}

@Test
public void compareCharArr() { //char[]
int bytes = Character.BYTES;
Expand All @@ -86,7 +86,7 @@ public void compareCharArr() { //char[]
int iPer = 8 / bytes;
int nLongs = arrLen / iPer;
int shift = 64 / iPer;

for (int i = 0; i < trials; i++) { //trials
for (int j = 0; j < nLongs; j++) { //longs
long r = rand.nextLong();
Expand All @@ -100,7 +100,7 @@ public void compareCharArr() { //char[]
assertEquals(res2, res1);
}
}

@Test
public void compareByteArr() { //byte[]
int bytes = Byte.BYTES;
Expand All @@ -109,7 +109,7 @@ public void compareByteArr() { //byte[]
int iPer = 8 / bytes;
int nLongs = arrLen / iPer;
int shift = 64 / iPer;

for (int i = 0; i < trials; i++) { //trials
for (int j = 0; j < nLongs; j++) { //longs
long r = rand.nextLong();
Expand All @@ -123,7 +123,7 @@ public void compareByteArr() { //byte[]
assertEquals(res2, res1);
}
}

@Test
public void compareLongVsLongArr() {
int arrLen = 1;
Expand All @@ -137,55 +137,55 @@ public void compareLongVsLongArr() {
assertEquals(res2, res1);
}
}

private static final long[] hashV1(long[] key, long seed) {
return MurmurHash3.hash(key, seed);
}

private static final long[] hashV1(int[] key, long seed) {
return MurmurHash3.hash(key, seed);
}

private static final long[] hashV1(char[] key, long seed) {
return MurmurHash3.hash(key, seed);
}

private static final long[] hashV1(byte[] key, long seed) {
return MurmurHash3.hash(key, seed);
}

private static final long[] hashV2(long[] key, long seed) {
return MurmurHash3v2.hash(key, seed);
}

private static final long[] hashV2(int[] key2, long seed) {
return MurmurHash3v2.hash(key2, seed);
}

private static final long[] hashV2(char[] key, long seed) {
return MurmurHash3v2.hash(key, seed);
}

private static final long[] hashV2(byte[] key, long seed) {
return MurmurHash3v2.hash(key, seed);
}

//V2 single primitives

private static final long[] hashV2(long key, long seed, long[] out) {
return MurmurHash3v2.hash(key, seed, out);
}

// private static final long[] hashV2(double key, long seed, long[] out) {
// return MurmurHash3v2.hash(key, seed, out);
// }

// private static final long[] hashV2(String key, long seed, long[] out) {
// return MurmurHash3v2.hash(key, seed, out);
// }



@Test
public void offsetChecks() {
long seed = 12345;
Expand Down
Expand Up @@ -278,9 +278,6 @@ public void checkDirectUnionSingleItem() {
//println(csk.toString(true, true, 1, true));
}




@Test
public void printlnTest() {
println("PRINTING: "+this.getClass().getName());
Expand Down

0 comments on commit 7c2c57d

Please sign in to comment.