]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/ed25519: skip allocations test on -noopt builder
authorFilippo Valsorda <filippo@golang.org>
Thu, 6 May 2021 01:32:04 +0000 (21:32 -0400)
committerFilippo Valsorda <filippo@golang.org>
Thu, 6 May 2021 02:20:28 +0000 (02:20 +0000)
Without optimizations, there will be unexpected allocations.

Change-Id: I90dc2636279b7fda7689eabc763251c4cdd25874
Reviewed-on: https://go-review.googlesource.com/c/go/+/317370
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
src/crypto/ed25519/ed25519_test.go
src/crypto/ed25519/internal/edwards25519/edwards25519_test.go

index ba9970e23e5dae1489515e8c2beae8008a125172..8a973b36eafb7b3b57923d72e700b97b6062c64f 100644 (file)
@@ -186,6 +186,9 @@ func TestMalleability(t *testing.T) {
 }
 
 func TestAllocations(t *testing.T) {
+       if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-noopt") {
+               t.Skip("skipping allocations test without relevant optimizations")
+       }
        if allocs := testing.AllocsPerRun(100, func() {
                seed := make([]byte, SeedSize)
                message := []byte("Hello, world!")
index ac7c78c0867f04139ba07e45739da9afa3a0e541..8031256525a53487fcadfbcfee4f971abe9611d0 100644 (file)
@@ -7,7 +7,9 @@ package edwards25519
 import (
        "crypto/ed25519/internal/edwards25519/field"
        "encoding/hex"
+       "os"
        "reflect"
+       "strings"
        "testing"
 )
 
@@ -279,6 +281,9 @@ func TestNonCanonicalPoints(t *testing.T) {
 var testAllocationsSink byte
 
 func TestAllocations(t *testing.T) {
+       if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-noopt") {
+               t.Skip("skipping allocations test without relevant optimizations")
+       }
        if allocs := testing.AllocsPerRun(100, func() {
                p := NewIdentityPoint()
                p.Add(p, NewGeneratorPoint())