diff --git a/gumble/go-openal/openal/openal_test.go b/gumble/go-openal/openal/openal_test.go index 1c2fb7e..9443414 100644 --- a/gumble/go-openal/openal/openal_test.go +++ b/gumble/go-openal/openal/openal_test.go @@ -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 {