diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-04-16 16:35:18 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-04-17 13:48:18 +0000 |
| commit | acc528cbf40c42eb112d2ce66c5f778bd4a397fb (patch) | |
| tree | 1db39cbb9517df790fdf189d3bd1f59e4b7a8b0c /pkg/report/linux_test.go | |
| parent | 18f6e127bf6e515fc3eee0936bde2415e676e160 (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/report/linux_test.go')
| -rw-r--r-- | pkg/report/linux_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
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) } } |
