From acc528cbf40c42eb112d2ce66c5f778bd4a397fb Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 16 Apr 2024 16:35:18 +0200 Subject: 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. --- pkg/cover/backend/dwarf_test.go | 8 ++++---- pkg/cover/cover_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/cover') 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 { -- cgit mrf-deployment