aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/cover
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-04-16 16:35:18 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-04-17 13:48:18 +0000
commitacc528cbf40c42eb112d2ce66c5f778bd4a397fb (patch)
tree1db39cbb9517df790fdf189d3bd1f59e4b7a8b0c /pkg/cover
parent18f6e127bf6e515fc3eee0936bde2415e676e160 (diff)
tools/syz-linter: check t.Logf/Errorf/Fatalf messages
Fix checking of Logf, it has string in 0-th arg. Add checking of t.Errorf/Fatalf.
Diffstat (limited to 'pkg/cover')
-rw-r--r--pkg/cover/backend/dwarf_test.go8
-rw-r--r--pkg/cover/cover_test.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/cover/backend/dwarf_test.go b/pkg/cover/backend/dwarf_test.go
index 9d4da8e90..d95c1ec01 100644
--- a/pkg/cover/backend/dwarf_test.go
+++ b/pkg/cover/backend/dwarf_test.go
@@ -27,12 +27,12 @@ func TestIsKcovBrokenInCompiler(t *testing.T) {
}
for _, ver := range inputDataTrue {
if !isKcovBrokenInCompiler(ver) {
- t.Fatalf("isKcovBrokenInCompiler(%q) unexpectedly returned false\n", ver)
+ t.Fatalf("isKcovBrokenInCompiler(%q) unexpectedly returned false", ver)
}
}
for _, ver := range inputDataFalse {
if isKcovBrokenInCompiler(ver) {
- t.Fatalf("isKcovBrokenInCompiler(%q) unexpectedly returned true\n", ver)
+ t.Fatalf("isKcovBrokenInCompiler(%q) unexpectedly returned true", ver)
}
}
}
@@ -94,7 +94,7 @@ func TestCleanPathAndroid(t *testing.T) {
path, epath, ename := files[0], files[1], files[2]
rpath, rname := cleanPathAndroid(path, test.SrcDir, test.Delimiters, test.FnExists)
if (rpath != epath) || (rname != ename) {
- t.Fatalf("cleanPathAndroid(`%s`, `%s`, %v, ...) unexpectedly returned (`%s`, `%s`) instead of (`%s`, `%s`)\n",
+ t.Fatalf("cleanPathAndroid(`%s`, `%s`, %v, ...) unexpectedly returned (`%s`, `%s`) instead of (`%s`, `%s`)",
path, test.SrcDir, test.Delimiters, rpath, rname, epath, ename)
}
}
@@ -113,7 +113,7 @@ func runNextCallTarget(t *testing.T, arg NextCallTargetTest) {
i := 0
target, pc := nextCallTarget(arg.Arch, arg.Text, arg.Data, &i)
if target != arg.ExpTarget || pc != arg.ExpPC {
- t.Fatalf("nextCallTarget(`%v`, %x, %v) unexpectedly returned (%x, %x) instead of (%x, %x)\n",
+ t.Fatalf("nextCallTarget(`%v`, %x, %v) unexpectedly returned (%x, %x) instead of (%x, %x)",
arg.Arch, arg.Text, arg.Data, target, pc, arg.ExpTarget, arg.ExpPC)
}
}
diff --git a/pkg/cover/cover_test.go b/pkg/cover/cover_test.go
index 2124fb3c8..d5f214ff5 100644
--- a/pkg/cover/cover_test.go
+++ b/pkg/cover/cover_test.go
@@ -51,7 +51,7 @@ func TestMergeDiff(t *testing.T) {
cov.Merge(test.init)
diff := cov.MergeDiff(test.merge)
if res := cmp.Diff(test.diff, diff); res != "" {
- t.Fatalf("MergeDiff result is wrong: %v", res)
+ t.Fatalf("result is wrong: %v", res)
}
result := cov.Serialize()
sort.Slice(result, func(i, j int) bool {