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 /prog/test_util.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 'prog/test_util.go')
| -rw-r--r-- | prog/test_util.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/prog/test_util.go b/prog/test_util.go index eb15539ea..fb45a8566 100644 --- a/prog/test_util.go +++ b/prog/test_util.go @@ -36,7 +36,7 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target t.Errorf("both Err and Out are set") } if test.In == test.Out { - t.Errorf("In and Out are equal, remove Out in such case\n%v", test.In) + t.Errorf("in and out are equal, remove Out in such case\n%v", test.In) } if test.Out == "" { test.Out = test.In @@ -49,7 +49,7 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target } if err != nil { if wantErr == "" { - t.Fatalf("deserialization failed with\n%s\ndata:\n%s\n", + t.Fatalf("deserialization failed with\n%s\ndata:\n%s", err, test.In) } if !strings.Contains(err.Error(), wantErr) { @@ -58,7 +58,7 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target } } else { if wantErr != "" { - t.Fatalf("deserialization should have failed with:\n%s\ndata:\n%s\n", + t.Fatalf("deserialization should have failed with:\n%s\ndata:\n%s", wantErr, test.In) } if transform != nil { @@ -72,7 +72,7 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target // the verbose and non-verbose output don't match -- the strict parsing // mode does not accept the non-verbose output as input. if want != output && want != outputVerbose { - t.Fatalf("wrong serialized data:\n%s\nexpect:\n%s\n", outputVerbose, want) + t.Fatalf("wrong serialized data:\n%s\nexpect:\n%s", outputVerbose, want) } p.SerializeForExec() } |
