Skip to content

test: protocol handler and decoder unit tests#75

Merged
chrisuthe merged 2 commits intomainfrom
test/protocol-handler-decoder-unit-tests
Mar 8, 2026
Merged

test: protocol handler and decoder unit tests#75
chrisuthe merged 2 commits intomainfrom
test/protocol-handler-decoder-unit-tests

Conversation

@chrisuthe
Copy link
Copy Markdown
Owner

Summary

  • Volume clamping: Verify setVolume() clamps 0.0-1.0 float input to 0-100% integer range, including out-of-bounds values like 1.5 and -0.1
  • Metadata deduplication: Verify duplicate TrackMetadata only fires onMetadataUpdate once (tests the lastMetadata dedup logic from PR fix: skip unchanged server state and group updates #65)
  • Sync state validation: Verify setSyncState() rejects invalid values -- only "synchronized" and "error" are accepted; invalid strings, empty strings, and case mismatches are all rejected
  • AudioDecoderFactory fallback: Verify create("aac") and other unknown codecs fall back to PcmDecoder

Test plan

  • All 16 test cases pass locally via ./gradlew :app:testDebugUnitTest
  • CI build passes
  • No existing tests broken

…olHandler

Verify setVolume() clamps 0.0-1.0 input to 0-100% integer range,
and that duplicate TrackMetadata only fires onMetadataUpdate once
(lastMetadata dedup logic).
@chrisuthe chrisuthe merged commit 1fc7bb6 into main Mar 8, 2026
Verify setSyncState() rejects invalid values (only "synchronized" and
"error" accepted), and that AudioDecoderFactory.create() falls back to
PcmDecoder for unknown codecs like "aac".
@chrisuthe chrisuthe deleted the test/protocol-handler-decoder-unit-tests branch March 12, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant