Test OpenAL buffer deletion

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:41:52 -04:00
committed by Brandon McGinty
parent 977b690eed
commit 3e9c9e7a81
+24
View File
@@ -5,6 +5,30 @@ import (
"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) {
device := openal.OpenDevice("")
if device == nil {