mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-25 23:43:49 +00:00
16 lines
318 B
Go
16 lines
318 B
Go
|
package opcode
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
// IsValid() is called for every VM instruction.
|
||
|
func BenchmarkIsValid(t *testing.B) {
|
||
|
// Just so that we don't always test the same opcode.
|
||
|
script := []Opcode{NOP, ADD, SYSCALL, APPEND, 0xff, 0xf0}
|
||
|
l := len(script)
|
||
|
for n := 0; n < t.N; n++ {
|
||
|
_ = IsValid(script[n%l])
|
||
|
}
|
||
|
}
|