mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/ed25519: skip allocations test on -noopt builder
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>
This commit is contained in:
parent
cf73f1a8e4
commit
43c390a1fa
2 changed files with 8 additions and 0 deletions
|
|
@ -186,6 +186,9 @@ func TestMalleability(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAllocations(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() {
|
if allocs := testing.AllocsPerRun(100, func() {
|
||||||
seed := make([]byte, SeedSize)
|
seed := make([]byte, SeedSize)
|
||||||
message := []byte("Hello, world!")
|
message := []byte("Hello, world!")
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@ package edwards25519
|
||||||
import (
|
import (
|
||||||
"crypto/ed25519/internal/edwards25519/field"
|
"crypto/ed25519/internal/edwards25519/field"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -279,6 +281,9 @@ func TestNonCanonicalPoints(t *testing.T) {
|
||||||
var testAllocationsSink byte
|
var testAllocationsSink byte
|
||||||
|
|
||||||
func TestAllocations(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() {
|
if allocs := testing.AllocsPerRun(100, func() {
|
||||||
p := NewIdentityPoint()
|
p := NewIdentityPoint()
|
||||||
p.Add(p, NewGeneratorPoint())
|
p.Add(p, NewGeneratorPoint())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue