aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard
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 /dashboard
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 'dashboard')
-rw-r--r--dashboard/app/access_test.go2
-rw-r--r--dashboard/app/api_test.go10
-rw-r--r--dashboard/app/app_test.go4
-rw-r--r--dashboard/app/reporting_test.go4
-rw-r--r--dashboard/app/repro_test.go2
5 files changed, 11 insertions, 11 deletions
diff --git a/dashboard/app/access_test.go b/dashboard/app/access_test.go
index 8652fca87..208d79a29 100644
--- a/dashboard/app/access_test.go
+++ b/dashboard/app/access_test.go
@@ -373,7 +373,7 @@ func TestAccess(t *testing.T) {
continue
}
if bytes.Contains(reply, []byte(ent.ref)) {
- t.Errorf("request %v at level %v contains ref %v at level %v:\n%s\n\n",
+ t.Errorf("request %v at level %v contains ref %v at level %v:\n%s",
url, requestLevel, ent.ref, ent.level, reply)
}
}
diff --git a/dashboard/app/api_test.go b/dashboard/app/api_test.go
index 4a872231e..6897848cf 100644
--- a/dashboard/app/api_test.go
+++ b/dashboard/app/api_test.go
@@ -17,7 +17,7 @@ func TestClientSecretOK(t *testing.T) {
},
}, "user", "secr1t", "")
if err != nil || got != "" {
- t.Errorf("Unexpected error %v %v", got, err)
+ t.Errorf("unexpected error %v %v", got, err)
}
}
@@ -28,7 +28,7 @@ func TestClientOauthOK(t *testing.T) {
},
}, "user", "", "OauthSubject:public")
if err != nil || got != "" {
- t.Errorf("Unexpected error %v %v", got, err)
+ t.Errorf("unexpected error %v %v", got, err)
}
}
@@ -39,7 +39,7 @@ func TestClientSecretFail(t *testing.T) {
},
}, "user", "wrong", "")
if err != ErrAccess || got != "" {
- t.Errorf("Unexpected error %v %v", got, err)
+ t.Errorf("unexpected error %v %v", got, err)
}
}
@@ -48,7 +48,7 @@ func TestClientSecretMissing(t *testing.T) {
Clients: map[string]string{},
}, "user", "ignored", "")
if err != ErrAccess || got != "" {
- t.Errorf("Unexpected error %v %v", got, err)
+ t.Errorf("unexpected error %v %v", got, err)
}
}
@@ -63,7 +63,7 @@ func TestClientNamespaceOK(t *testing.T) {
},
}, "user", "secr1t", "")
if err != nil || got != "ns1" {
- t.Errorf("Unexpected error %v %v", got, err)
+ t.Errorf("unexpected error %v %v", got, err)
}
}
diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go
index 4e8e4efde..99da350aa 100644
--- a/dashboard/app/app_test.go
+++ b/dashboard/app/app_test.go
@@ -947,7 +947,7 @@ func TestPurgeOldCrashes(t *testing.T) {
// A sanity check for the test itself.
if !firstCrashExists() {
- t.Fatalf("The first reported crash should be present")
+ t.Fatalf("the first reported crash should be present")
}
// Unreport the first crash.
@@ -970,7 +970,7 @@ func TestPurgeOldCrashes(t *testing.T) {
}
// Check that the unreported crash was purged.
if firstCrashExists() {
- t.Fatalf("The unreported crash should have been purged.")
+ t.Fatalf("the unreported crash should have been purged")
}
}
diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go
index c0d419418..7515cd810 100644
--- a/dashboard/app/reporting_test.go
+++ b/dashboard/app/reporting_test.go
@@ -968,10 +968,10 @@ func TestUpdateBugReporting(t *testing.T) {
setIDs(bug, test.After)
hasError := bug.updateReportings(c.ctx, cfg, now) != nil
if hasError != test.Error {
- t.Errorf("Before: %#v, Expected error: %v, Got error: %v", test.Before, test.Error, hasError)
+ t.Errorf("before: %#v, expected error: %v, got error: %v", test.Before, test.Error, hasError)
}
if !test.Error && !reflect.DeepEqual(bug.Reporting, test.After) {
- t.Errorf("Before: %#v, Expected After: %#v, Got After: %#v", test.Before, test.After, bug.Reporting)
+ t.Errorf("before: %#v, expected after: %#v, got after: %#v", test.Before, test.After, bug.Reporting)
}
}
}
diff --git a/dashboard/app/repro_test.go b/dashboard/app/repro_test.go
index 8c587324e..db37046d6 100644
--- a/dashboard/app/repro_test.go
+++ b/dashboard/app/repro_test.go
@@ -337,7 +337,7 @@ func TestNeedReproIsolated(t *testing.T) {
}
funcResult := needReproForBug(c.ctx, bug)
if funcResult != test.needRepro {
- t.Errorf("For %#v expected needRepro=%v, got needRepro=%v",
+ t.Errorf("for %#v expected needRepro=%v, got needRepro=%v",
bug, test.needRepro, funcResult)
}
}