test(gap): cover malformed 16/32-bit UUID lists and multi-manufacturer#231
Merged
Conversation
Closes the remaining branch-coverage gaps in gap.py: - 16-bit UUID list with an odd trailing byte: the loop must drop the remainder rather than fold it into a synthetic UUID. Mirrors the 128-bit malformed-length protection from #226. - 32-bit UUID list with a 1-3 byte trailing remainder: same shape, drop the tail. - Two Manufacturer Specific Data AD structs in a single packet, both surviving into the manufacturer_data dict. The MSD AD type is allowed more than once per advertisement (Core Spec Vol 3 Part C §11) but every existing fixture only carried a single entry, leaving the "second-entry" path untested. gap.py branch coverage: 99% -> 100%. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #231 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 251 251
Branches 40 40
=========================================
Hits 251 251 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bdraco
approved these changes
May 17, 2026
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.
What
Add three tests that close the remaining branch-coverage gaps in
gap.py, taking it from 99% → 100% branch coverage.Why
Recent malformed-AD hardening (#221, #222, #226, #227) focused on the 128-bit UUID list and TX Power branches. Coverage shows three sibling paths still exercised by no test:
A regression in any of these would silently fold garbage into
service_uuidsor drop a valid manufacturer entry; the parser already handles them correctly, the tests just lock that in.How
Test-only change. Three new tests in
tests/test_gap.py:test_parse_advertisement_data_16bit_uuid_malformed_lengthtest_parse_advertisement_data_32bit_uuid_malformed_lengthtest_parse_advertisement_data_multiple_manufacturer_entriesTesting
🤖 Generated with Claude Code
Quality Report
Changes: 1 file changed, 59 insertions(+)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline