Test OpenAL buffer deletion
This commit is contained in:
committed by
Brandon McGinty
parent
977b690eed
commit
3e9c9e7a81
@@ -5,6 +5,30 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Regression: Buffer.Delete called the source deletion API, which reported an
|
||||||
|
// invalid source and leaked the buffer.
|
||||||
|
func TestBufferDeleteUsesBufferAPI(t *testing.T) {
|
||||||
|
device := openal.OpenDevice("")
|
||||||
|
if device == nil {
|
||||||
|
t.Skip("OpenAL device is not available")
|
||||||
|
}
|
||||||
|
defer device.CloseDevice()
|
||||||
|
context := device.CreateContext()
|
||||||
|
if context == nil {
|
||||||
|
t.Skip("OpenAL context is not available")
|
||||||
|
}
|
||||||
|
defer context.Destroy()
|
||||||
|
context.Activate()
|
||||||
|
buffer := openal.NewBuffer()
|
||||||
|
if err := openal.Err(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
buffer.Delete()
|
||||||
|
if err := openal.Err(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGetVendor(t *testing.T) {
|
func TestGetVendor(t *testing.T) {
|
||||||
device := openal.OpenDevice("")
|
device := openal.OpenDevice("")
|
||||||
if device == nil {
|
if device == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user