Merged
Conversation
Add unit tests for INIT->WAITING_FOR_START transition, DRAINING state buffer exhaustion detection, and reanchor 5-second cooldown enforcement.
Add tests for concurrent enterDraining/exitDraining thread safety, MAX_SPEED_CORRECTION (+/-2%) clamping for insert/drop rates, and suppression of corrections during the 500ms startup grace period.
Add tests for 2-second reconnect stabilization guard, silence fill for gaps >10ms, small gap passthrough, overlap trimming, and complete overlap chunk skipping.
Add tests for pre-sync chunk buffering with MAX_PENDING_CHUNKS limit, 32-bit frame position wrap detection, 5-second baseline refresh interval, and additional state machine edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SyncAudioPlayercovering the playback state machine, sync correction logic, gap/overlap handling, and pre-sync bufferingSendspinTimeFilterand reflection for internal state verification sinceAudioTrackis unavailable in JVM unit testsandroid/app/src/test/java/com/sendspindroid/sendspin/SyncAudioPlayerTest.ktTests added (grouped by area):
State transitions & draining (tests 1-3)
Thread safety & correction guards (tests 4-6)
Reconnect & stream continuity (tests 7-9)
Buffering & timing infrastructure (tests 10-12)
Test plan
./gradlew :app:testDebugUnitTest --tests "com.sendspindroid.sendspin.SyncAudioPlayerTest")