mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/state: remove unused function xTestFuzzCutter
This commit is contained in:
parent
d78a095e41
commit
8d3ef0924a
1 changed files with 0 additions and 22 deletions
|
|
@ -18,10 +18,7 @@ package state
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
|
||||||
"math/rand"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
@ -47,22 +44,3 @@ func BenchmarkCutCustomTrim(b *testing.B) {
|
||||||
common.TrimLeftZeroes(value[:])
|
common.TrimLeftZeroes(value[:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func xTestFuzzCutter(t *testing.T) {
|
|
||||||
rand.Seed(time.Now().Unix())
|
|
||||||
for {
|
|
||||||
v := make([]byte, 20)
|
|
||||||
zeroes := rand.Intn(21)
|
|
||||||
rand.Read(v[zeroes:])
|
|
||||||
exp := bytes.TrimLeft(v[:], "\x00")
|
|
||||||
got := common.TrimLeftZeroes(v)
|
|
||||||
if !bytes.Equal(exp, got) {
|
|
||||||
|
|
||||||
fmt.Printf("Input %x\n", v)
|
|
||||||
fmt.Printf("Exp %x\n", exp)
|
|
||||||
fmt.Printf("Got %x\n", got)
|
|
||||||
t.Fatalf("Error")
|
|
||||||
}
|
|
||||||
//break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue