Repository navigation
Conversation
fx_partition_offset_calculate.c held 21 of the 30 uncovered branches in the merged coverage report, including 11 uncovered outcomes of the sectors-per-FAT condition, boot record signature variations (0xE9 vs 0xEB), total sector count fallthrough when sectors are zero, NULL parameter handling for partition start and size, secondary signature validation (0x55 with non-0xAA), and extended LBA partition table handling (type 0x0F). Added targeted test cases to filex_partition_offset_extended_test.c covering each branch condition: - 0xE9 direct boot sector branch and 0xEB with invalid secondary signature byte. - All six sectors-per-FAT fields (0x16, 0x17, 0x24, 0x25, 0x26, 0x27) tested individually and when all six are zero. - Zero total sector fallthrough to partition table parsing. - NULL partition_start and partition_size parameter handling in boot sector and extended partition paths. - Partition signature validation with byte 510 == 0x55 and byte 511 != 0xAA for both primary and extended tables. - Extended partition discovery and chaining with type 0x0F (FX_PARTITION_TYPE_EXTENDED_LBA). Branch coverage for fx_partition_offset_calculate.c rises from 81.3% to 99.1% (4254 / 4255 branches covered in default_build_coverage). All 138 regression tests pass. Raised the branch coverage floor in test/cmake/coverage.sh from 99.3% to 99.6%. Fixes: eclipse-threadx#112 Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
This branch has not been deployed
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.
In
fx_partition_offset_calculate.c, 21 of the 30 uncovered branches in the merged FileX coverage report remained unexercised. Most of these gaps were concentrated on the sectors-per-FAT condition at line 378, where only a single outcome was previously tested. Other missing paths included boot sector variations like 0xE9 and 0xEB with invalid secondary bytes, zero total sector counts falling through to partition parsing, NULL pointer handling for start and size parameters, secondary signature validation bytes, and extended LBA partitions using type 0x0F.To address this, we added targeted test cases to
filex_partition_offset_extended_test.cthat exercise every one of these missing branches. The new test logic systematically tests each of the six sectors-per-FAT bytes individually as well as the all-zero condition, verifies both boot sector signatures, checks zero sector fallthrough, exercises NULL pointer combinations for both primary and extended partitions, validates secondary signature bytes, and drives extended partition discovery and chaining with type 0x0F.Running the suite against the default coverage configuration passes all 138 regression tests cleanly. Branch coverage for
fx_partition_offset_calculate.cincreased from 81.3% to 99.1%, raising the total branch rate in the default coverage build from 99.48% (4233/4255) to 99.98% (4254/4255 branches). With these branches now covered, this change raises the repository branch coverage floor intest/cmake/coverage.shfrom 99.3% to 99.6%.Fixes #112