fixed (bug) Audio not looping after ending.
build-dev / nix-build (push) Successful in 46s

This commit is contained in:
NeilClack
2026-08-28 13:55:20 -05:00
parent 3f6201182e
commit 2917d33866
4 changed files with 156 additions and 22 deletions
+11
View File
@@ -59,3 +59,14 @@ TEST(AudioTest, AudioManagerVolumeClamping) {
am.shutdown();
std::filesystem::remove(temp_path);
}
TEST(AudioTest, PlayOptionsLoopInfinite) {
// Regression: MIX_PlayTrack() must not default to a single pass. Tracks
// have to loop forever so playback never runs out mid-scroll; a track that
// stops (rather than attenuates) also can't be revived by raising app
// volume. Assert the options request infinite looping (-1).
SDL_PropertiesID props = AudioManager::createInfiniteLoopOptions();
ASSERT_NE(props, 0u);
EXPECT_EQ(SDL_GetNumberProperty(props, MIX_PROP_PLAY_LOOPS_NUMBER, 0), -1);
SDL_DestroyProperties(props);
}