]> Cypherpunks repositories - gostls13.git/commitdiff
all: rename type *testing.B variable to 'b'
authorLudi Rehak <ludi317@gmail.com>
Mon, 18 Apr 2022 23:39:24 +0000 (16:39 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 2 May 2022 14:44:49 +0000 (14:44 +0000)
Reserve 't' for type *testing.T variables.

Change-Id: I037328df59d3af1aa28714f9efe15695b6fd62a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/400826
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/crypto/ecdsa/ecdsa_test.go
src/crypto/ed25519/internal/edwards25519/scalarmult_test.go
src/crypto/elliptic/elliptic_test.go

index c8390b2cc9ffc4516b79114a5d40178ba6a0c22a..77a81343165cffdcf88644ddbda2c38215971652 100644 (file)
@@ -327,7 +327,7 @@ func testZeroHashSignature(t *testing.T, curve elliptic.Curve) {
        }
 }
 
-func benchmarkAllCurves(t *testing.B, f func(*testing.B, elliptic.Curve)) {
+func benchmarkAllCurves(b *testing.B, f func(*testing.B, elliptic.Curve)) {
        tests := []struct {
                name  string
                curve elliptic.Curve
@@ -339,8 +339,8 @@ func benchmarkAllCurves(t *testing.B, f func(*testing.B, elliptic.Curve)) {
        }
        for _, test := range tests {
                curve := test.curve
-               t.Run(test.name, func(t *testing.B) {
-                       f(t, curve)
+               b.Run(test.name, func(b *testing.B) {
+                       f(b, curve)
                })
        }
 }
index c2027f5ddbd20f044795b64cce9d67cf4b29ab6a..17606038582dc5f3189dc40652955a795e3da612 100644 (file)
@@ -184,26 +184,26 @@ func TestVarTimeDoubleBaseMultMatchesBaseMult(t *testing.T) {
 
 // Benchmarks.
 
-func BenchmarkScalarBaseMult(t *testing.B) {
+func BenchmarkScalarBaseMult(b *testing.B) {
        var p Point
 
-       for i := 0; i < t.N; i++ {
+       for i := 0; i < b.N; i++ {
                p.ScalarBaseMult(&dalekScalar)
        }
 }
 
-func BenchmarkScalarMult(t *testing.B) {
+func BenchmarkScalarMult(b *testing.B) {
        var p Point
 
-       for i := 0; i < t.N; i++ {
+       for i := 0; i < b.N; i++ {
                p.ScalarMult(&dalekScalar, B)
        }
 }
 
-func BenchmarkVarTimeDoubleScalarBaseMult(t *testing.B) {
+func BenchmarkVarTimeDoubleScalarBaseMult(b *testing.B) {
        var p Point
 
-       for i := 0; i < t.N; i++ {
+       for i := 0; i < b.N; i++ {
                p.VarTimeDoubleScalarBaseMult(&dalekScalar, B, &dalekScalar)
        }
 }
index eb5f0546c45c64d5bf74b7ce6db8a6e64e785d34..6a79b82e2fdf13936319251fb0c171fdca90b28a 100644 (file)
@@ -305,7 +305,7 @@ func TestLargeIsOnCurve(t *testing.T) {
        })
 }
 
-func benchmarkAllCurves(t *testing.B, f func(*testing.B, Curve)) {
+func benchmarkAllCurves(b *testing.B, f func(*testing.B, Curve)) {
        tests := []struct {
                name  string
                curve Curve
@@ -317,8 +317,8 @@ func benchmarkAllCurves(t *testing.B, f func(*testing.B, Curve)) {
        }
        for _, test := range tests {
                curve := test.curve
-               t.Run(test.name, func(t *testing.B) {
-                       f(t, curve)
+               b.Run(test.name, func(b *testing.B) {
+                       f(b, curve)
                })
        }
 }