wp
This commit is contained in:
@@ -165,10 +165,11 @@ func TestCumulativeDeltaCompressor(t *testing.T) {
|
||||
var (
|
||||
fracDigits byte = 1
|
||||
buf = make([]byte, 8)
|
||||
payloadSize = 0
|
||||
compressionWay int
|
||||
requiredSpace int
|
||||
)
|
||||
c := NewCumulativeDeltaCompressor(buf, fracDigits)
|
||||
c := NewCumulativeDeltaCompressor(fracDigits, buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, requiredSpace = c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
@@ -281,9 +282,10 @@ func TestCumulativeDeltaDecompressorFromState(t *testing.T) {
|
||||
var (
|
||||
fracDigits byte = 1
|
||||
buf = make([]byte, 16)
|
||||
payloadSize = 0
|
||||
decodedNums []float64
|
||||
)
|
||||
c := NewCumulativeDeltaCompressor(buf, fracDigits)
|
||||
c := NewCumulativeDeltaCompressor(fracDigits, buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, _ := c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
@@ -524,10 +526,11 @@ func TestInstantDeltaCompressor(t *testing.T) {
|
||||
var (
|
||||
fracDigits byte = 1
|
||||
buf = make([]byte, 8)
|
||||
payloadSize = 0
|
||||
compressionWay int
|
||||
requiredSpace int
|
||||
)
|
||||
c := NewInstantDeltaCompressor(buf, fracDigits)
|
||||
c := NewInstantDeltaCompressor(fracDigits, buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, requiredSpace = c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
@@ -640,9 +643,10 @@ func TestInstantDeltaDecompressorFromState(t *testing.T) {
|
||||
var (
|
||||
fracDigits byte = 1
|
||||
buf = make([]byte, 16)
|
||||
payloadSize = 0
|
||||
decodedNums []float64
|
||||
)
|
||||
c := NewInstantDeltaCompressor(buf, fracDigits)
|
||||
c := NewInstantDeltaCompressor(fracDigits, buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, _ := c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
@@ -840,10 +844,11 @@ func TestTimeDeltaCompressor(t *testing.T) {
|
||||
//fmt.Println("----------")
|
||||
var (
|
||||
buf = make([]byte, 8)
|
||||
payloadSize = 0
|
||||
compressionWay int
|
||||
requiredSpace int
|
||||
)
|
||||
c := NewTimeDeltaCompressor(buf)
|
||||
c := NewTimeDeltaCompressor(buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, requiredSpace = c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
@@ -957,9 +962,10 @@ func TestTimeDeltaDecompressorFromState(t *testing.T) {
|
||||
for caseIdx, testCase := range testCases {
|
||||
var (
|
||||
buf = make([]byte, 16)
|
||||
payloadSize = 0
|
||||
decodedNums []uint32
|
||||
)
|
||||
c := NewTimeDeltaCompressor(buf)
|
||||
c := NewTimeDeltaCompressor(buf, payloadSize)
|
||||
for _, num := range testCase.Nums {
|
||||
compressionWay, _ := c.Evaluate(num)
|
||||
c.Compress(compressionWay, num)
|
||||
|
||||
Reference in New Issue
Block a user