mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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"
|
||||
"crypto/rand"
|
||||
"io"
|
||||
"runtime"
|
||||
"testing"
|
||||
"unsafe"
|
||||
|
||||
@ -35,6 +36,7 @@ func randInt16s(n int) []int16 {
|
||||
func TestFloat32(t *testing.T) {
|
||||
cases := []struct {
|
||||
In []int16
|
||||
SkipOnBrowserReason string
|
||||
}{
|
||||
{
|
||||
In: nil,
|
||||
@ -50,9 +52,13 @@ func TestFloat32(t *testing.T) {
|
||||
},
|
||||
{
|
||||
In: randInt16s(65536),
|
||||
SkipOnBrowserReason: "entropy is not enough on browser to generate random numbers",
|
||||
},
|
||||
}
|
||||
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.
|
||||
var in, out []byte
|
||||
if len(c.In) > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user