mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-09 09:24:43 +01:00
audio/internal/convert: bug fix: skip some tests on browsers
This commit is contained in:
parent
43f505b3a0
commit
96a07c1bf2
@ -18,6 +18,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"io"
|
"io"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
@ -34,7 +35,8 @@ func randInt16s(n int) []int16 {
|
|||||||
|
|
||||||
func TestFloat32(t *testing.T) {
|
func TestFloat32(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
In []int16
|
In []int16
|
||||||
|
SkipOnBrowserReason string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
In: nil,
|
In: nil,
|
||||||
@ -49,10 +51,14 @@ func TestFloat32(t *testing.T) {
|
|||||||
In: randInt16s(256),
|
In: randInt16s(256),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
In: randInt16s(65536),
|
In: randInt16s(65536),
|
||||||
|
SkipOnBrowserReason: "entropy is not enough on browser to generate random numbers",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, c := range cases {
|
for _, c := range cases {
|
||||||
|
if runtime.GOOS == "js" && c.SkipOnBrowserReason != "" {
|
||||||
|
t.Skip(c.SkipOnBrowserReason)
|
||||||
|
}
|
||||||
// Note that unsafe.SliceData is available as of Go 1.20.
|
// Note that unsafe.SliceData is available as of Go 1.20.
|
||||||
var in, out []byte
|
var in, out []byte
|
||||||
if len(c.In) > 0 {
|
if len(c.In) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user