vorbis: Embed files for tests

Updates #881
This commit is contained in:
Hajime Hoshi 2019-09-15 19:50:53 +09:00
parent 1acf110078
commit 689d230cb7
4 changed files with 33 additions and 9 deletions

19
audio/vorbis/generate.go Normal file
View File

@ -0,0 +1,19 @@
// Copyright 2019 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:generate file2byteslice -package=vorbis_test -input=./test_mono.ogg -output=./testmonoogg_test.go -var=test_mono_ogg
//go:generate file2byteslice -package=vorbis_test -input=./test_tooshort.ogg -output=./testtooshortogg_test.go -var=test_tooshort_ogg
//go:generate gofmt -s -w .
package vorbis

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,6 @@
package vorbis_test
import (
"io/ioutil"
"testing"
"github.com/jfreymuth/oggvorbis"
@ -35,10 +34,7 @@ func init() {
}
func TestMono(t *testing.T) {
bs, err := ioutil.ReadFile("test_mono.ogg")
if err != nil {
t.Fatal(err)
}
bs := test_mono_ogg
s, err := Decode(audioContext, audio.BytesReadSeekCloser(bs))
if err != nil {
@ -64,10 +60,7 @@ func TestMono(t *testing.T) {
}
func TestTooShort(t *testing.T) {
bs, err := ioutil.ReadFile("test_tooshort.ogg")
if err != nil {
t.Fatal(err)
}
bs := test_tooshort_ogg
s, err := Decode(audioContext, audio.BytesReadSeekCloser(bs))
if err != nil {