mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:37:35 +00:00
LibAudio: Add a test for creating and destructing a PlaybackStream
This will ensure that we don't leak any memory while playing back audio. There is an expectation value in the test that is only set to true when PulseAudio is present for the moment. When any new implementation is added for other libraries/platforms, we should hopefully get a CI failure due to unexpected success in creating the `PlaybackStream`. To ensure that we clean up our PulseAudio connection whenever audio output is not needed, add `PulseAudioContext::weak_instance()` to allow us to check whether an instance exists without creating one.
This commit is contained in:
parent
515b255fa4
commit
50c73d02f0
5 changed files with 58 additions and 1 deletions
|
@ -661,6 +661,11 @@ if (BUILD_LAGOM)
|
|||
# The FLAC tests need a special working directory to find the test files
|
||||
lagom_test(../../Tests/LibAudio/TestFLACSpec.cpp LIBS LibAudio WORKING_DIRECTORY "${FLAC_TEST_PATH}/..")
|
||||
|
||||
lagom_test(../../Tests/LibAudio/TestPlaybackStream.cpp LIBS LibAudio)
|
||||
if (HAVE_PULSEAUDIO)
|
||||
target_compile_definitions(TestPlaybackStream PRIVATE HAVE_PULSEAUDIO=1)
|
||||
endif()
|
||||
|
||||
# LibCore
|
||||
if ((LINUX OR APPLE) AND NOT EMSCRIPTEN)
|
||||
lagom_test(../../Tests/LibCore/TestLibCoreFileWatcher.cpp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue