From 3e9c9e7a81246e52704bbcacefd578c96718ab2f Mon Sep 17 00:00:00 2001 From: "Brandon McGinty (chatgpt)" Date: Sun, 9 Aug 2026 14:41:52 -0400 Subject: [PATCH] Test OpenAL buffer deletion --- gumble/go-openal/openal/openal_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 {