aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/testutil
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-12-13 15:15:49 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-12-17 13:44:24 +0000
commitc8c15bb214509bafc8fe1a1e3abb8ccf90b3306e (patch)
treeca722a71aff5a1566389f178d9c95d7d7e8caeed /pkg/testutil
parentbc1a1b50f942408a9139887b914f745d9fa02adc (diff)
tools/syz-declextract: infer argument/field types
Use data flow analysis to infer syscall argument, return value, and struct field types. See the comment in pkg/declextract/typing.go for more details.
Diffstat (limited to 'pkg/testutil')
-rw-r--r--pkg/testutil/testutil.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go
index 153584dd5..b2ec06afb 100644
--- a/pkg/testutil/testutil.go
+++ b/pkg/testutil/testutil.go
@@ -90,3 +90,12 @@ func randValue(t *testing.T, rnd *rand.Rand, typ reflect.Type) reflect.Value {
}
return v
}
+
+type Writer struct {
+ testing.TB
+}
+
+func (w *Writer) Write(data []byte) (int, error) {
+ w.TB.Logf("%s", data)
+ return len(data), nil
+}