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/report/linux_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/report/linux_test.go') diff --git a/pkg/report/linux_test.go b/pkg/report/linux_test.go index 5f27b9e7d..258efb271 100644 --- a/pkg/report/linux_test.go +++ b/pkg/report/linux_test.go @@ -248,7 +248,7 @@ func prepareLinuxReporter(t *testing.T, arch string) (*Reporter, *linux) { } reporter, err := NewReporter(cfg) if err != nil { - t.Errorf("Failed to create a reporter instance for %#v: %v", arch, err) + t.Errorf("failed to create a reporter instance for %#v: %v", arch, err) } return reporter, reporter.impl.(*linux) } @@ -369,11 +369,11 @@ func TestParseLinuxOpcodes(t *testing.T) { _, linuxReporter := prepareLinuxReporter(t, test.arch) ret, err := linuxReporter.parseOpcodes(test.input) if test.output == nil && err == nil { - t.Errorf("Expected an error on input %#v", test) + t.Errorf("expected an error on input %#v", test) } else if test.output != nil && err != nil { - t.Errorf("Unexpected error %v on input %#v", err, test.input) + t.Errorf("unexpected error %v on input %#v", err, test.input) } else if test.output != nil && !reflect.DeepEqual(ret, *test.output) { - t.Errorf("Expected: %#v, got: %#v", test.output, ret) + t.Errorf("expected: %#v, got: %#v", test.output, ret) } }) } @@ -441,6 +441,6 @@ func testDisassembly(t *testing.T, reporter *Reporter, linuxReporter *linux, tes } if !bytes.Equal(output, result) { - t.Fatalf("Expected:\n%s\nGot:\n%s\n", output, result) + t.Fatalf("expected:\n%s\ngot:\n%s", output, result) } } -- cgit mrf-deployment