forked from koron/JavaFastPFOR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdhocTest.java
More file actions
47 lines (39 loc) · 1.18 KB
/
Copy pathAdhocTest.java
File metadata and controls
47 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package me.lemire.integercompression;
import java.util.Arrays;
import org.junit.Test;
import static org.junit.Assert.*;
import static me.lemire.integercompression.TestUtils.*;
/**
* Collection of adhoc tests.
*/
public class AdhocTest
{
@Test
public void biggerCompressedArray0() {
// No problem: for comparison.
IntegerCODEC c = new Composition(new FastPFOR(), new VariableByte());
assertSymmetry(c, 0, 16384);
}
@Test
public void biggerCompressedArray1() {
// Compressed array is bigger than original, because of VariableByte.
IntegerCODEC c = new VariableByte();
assertSymmetry(c, -1);
}
@Test
public void biggerCompressedArray2() {
// Compressed array is bigger than original, because of Composition.
IntegerCODEC c = new Composition(new FastPFOR(), new VariableByte());
assertSymmetry(c, 65535, 65535);
}
// NOTE: This require bigger 2 items for compressed array than original.
/*
@Test
public void overflowVariableByte() {
IntegerCODEC c = new VariableByte();
int[] d = new int[8];
Arrays.fill(d, -1);
assertSymmetry(c, d);
}
*/
}