aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ifuzz/ifuzz_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-11-20 19:28:53 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-11-21 08:46:20 +0100
commit418476ecb925e5d58ba9c22928a4e37dc30909df (patch)
tree702468b5ca1b0df89a83d861b18eaff9ae2237c5 /pkg/ifuzz/ifuzz_test.go
parente1dea42221c13dabdf9d4938428f1ef91863b813 (diff)
pkg/ifuzz/iset: rename ifuzzimpl to iset
ifuzzimpl is too lenghty and too clumsy on my taste (nm/vmimpl worked better b/c it's shorter and used less). I've tried to come up with something shorter and nicer. We could use "insn" as a common name for "instruction" in ifuzz, but it's a commonly used name already so would cause lots of conflicts. "iset" is somewhat descriptive, short and nice.
Diffstat (limited to 'pkg/ifuzz/ifuzz_test.go')
-rw-r--r--pkg/ifuzz/ifuzz_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/ifuzz/ifuzz_test.go b/pkg/ifuzz/ifuzz_test.go
index edee05c9a..eee8afe00 100644
--- a/pkg/ifuzz/ifuzz_test.go
+++ b/pkg/ifuzz/ifuzz_test.go
@@ -10,7 +10,7 @@ import (
"testing"
"time"
- "github.com/google/syzkaller/pkg/ifuzz/ifuzzimpl"
+ "github.com/google/syzkaller/pkg/ifuzz/iset"
)
var allArches = []string{ArchX86, ArchPowerPC}
@@ -24,8 +24,8 @@ func TestMode(t *testing.T) {
}
func testMode(t *testing.T, arch string) {
- all := make(map[ifuzzimpl.Insn]bool)
- for mode := ifuzzimpl.Mode(0); mode < ifuzzimpl.ModeLast; mode++ {
+ all := make(map[iset.Insn]bool)
+ for mode := iset.Mode(0); mode < iset.ModeLast; mode++ {
for priv := 0; priv < 2; priv++ {
for exec := 0; exec < 2; exec++ {
insns := allInsns(arch, mode, priv != 0, exec != 0)
@@ -48,7 +48,7 @@ func TestDecode(t *testing.T) {
}
func testDecode(t *testing.T, arch string) {
- insnset := ifuzzimpl.Arches[arch]
+ insnset := iset.Arches[arch]
xedEnabled := false
if _, err := insnset.DecodeExt(0, nil); err == nil {
xedEnabled = true
@@ -61,8 +61,8 @@ func testDecode(t *testing.T, arch string) {
r := rand.New(rand.NewSource(seed))
for repeat := 0; repeat < 10; repeat++ {
- for mode := ifuzzimpl.Mode(0); mode < ifuzzimpl.ModeLast; mode++ {
- cfg := &ifuzzimpl.Config{
+ for mode := iset.Mode(0); mode < iset.ModeLast; mode++ {
+ cfg := &iset.Config{
Mode: mode,
Priv: true,
Exec: true,
@@ -122,13 +122,13 @@ func testDecode(t *testing.T, arch string) {
}
}
-func allInsns(arch string, mode ifuzzimpl.Mode, priv, exec bool) []ifuzzimpl.Insn {
- insnset := ifuzzimpl.Arches[arch]
- insns := insnset.GetInsns(mode, ifuzzimpl.TypeUser)
+func allInsns(arch string, mode iset.Mode, priv, exec bool) []iset.Insn {
+ insnset := iset.Arches[arch]
+ insns := insnset.GetInsns(mode, iset.TypeUser)
if priv {
- insns = append(insns, insnset.GetInsns(mode, ifuzzimpl.TypePriv)...)
+ insns = append(insns, insnset.GetInsns(mode, iset.TypePriv)...)
if exec {
- insns = append(insns, insnset.GetInsns(mode, ifuzzimpl.TypeExec)...)
+ insns = append(insns, insnset.GetInsns(mode, iset.TypeExec)...)
}
}
return insns