aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/report_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-06-15 14:31:29 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-07-05 11:29:44 +0000
commitc8a08b381ddaa35d4e58e91b7d7d215c9fc66b87 (patch)
treea94782d4748cbc215b553910e22182ebf9cf75aa /pkg/report/report_test.go
parentd9b02a53a6f8a9f6af36ffdf2ac399e3376de807 (diff)
pkg/report: move report.Type to pkg/report/crash
This will help avoid a circular dependency pkg/vcs -> pkg/report -> pkg/vcs.
Diffstat (limited to 'pkg/report/report_test.go')
-rw-r--r--pkg/report/report_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/report/report_test.go b/pkg/report/report_test.go
index f6fa08cd8..ba41735a5 100644
--- a/pkg/report/report_test.go
+++ b/pkg/report/report_test.go
@@ -18,6 +18,7 @@ import (
"github.com/google/syzkaller/pkg/mgrconfig"
"github.com/google/syzkaller/pkg/osutil"
+ "github.com/google/syzkaller/pkg/report/crash"
"github.com/google/syzkaller/pkg/testutil"
"github.com/google/syzkaller/sys/targets"
)
@@ -33,7 +34,7 @@ type ParseTest struct {
Log []byte
Title string
AltTitles []string
- Type Type
+ Type crash.Type
Frame string
StartLine string
EndLine string
@@ -111,7 +112,7 @@ func parseHeaderLine(t *testing.T, test *ParseTest, ln string) {
case strings.HasPrefix(ln, altTitlePrefix):
test.AltTitles = append(test.AltTitles, ln[len(altTitlePrefix):])
case strings.HasPrefix(ln, typePrefix):
- test.Type = Type(ln[len(typePrefix):])
+ test.Type = crash.Type(ln[len(typePrefix):])
case strings.HasPrefix(ln, framePrefix):
test.Frame = ln[len(framePrefix):]
case strings.HasPrefix(ln, startPrefix):
@@ -157,7 +158,7 @@ func testParseImpl(t *testing.T, reporter *Reporter, test *ParseTest) {
if rep != nil && rep.Type == unspecifiedType {
t.Fatalf("unspecifiedType leaked outside")
}
- title, corrupted, corruptedReason, suppressed, typ, frame := "", false, "", false, UnknownType, ""
+ title, corrupted, corruptedReason, suppressed, typ, frame := "", false, "", false, crash.UnknownType, ""
var altTitles []string
if rep != nil {
title = rep.Title
@@ -239,13 +240,13 @@ func checkReport(t *testing.T, reporter *Reporter, rep *Report, test *ParseTest)
}
func updateReportTest(t *testing.T, test *ParseTest, title string, altTitles []string, corrupted, suppressed bool,
- typ Type, frame string) {
+ typ crash.Type, frame string) {
buf := new(bytes.Buffer)
fmt.Fprintf(buf, "TITLE: %v\n", title)
for _, t := range altTitles {
fmt.Fprintf(buf, "ALT: %v\n", t)
}
- if typ != UnknownType {
+ if typ != crash.UnknownType {
fmt.Fprintf(buf, "TYPE: %v\n", typ)
}
if test.Frame != "" {