Fix OpenKh.Command.Bbsa extraction logic#1263
Conversation
📝 WalkthroughWalkthrough
ChangesBbsa directory entry tail enumeration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
OpenKh.Bbs/Bbsa.cs (1)
648-657: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd targeted regression tests for tail enumeration branches.
Please add coverage for: (1)
DirectoryCount == 0returns allDirectoryEntries, and (2) remainder entries are emitted whenDirectoryEntriesCount % DirectoryCount != 0. This logic is central to the extraction/repack fix and should be locked in with tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@OpenKh.Bbs/Bbsa.cs` around lines 648 - 657, The GetDirectoryEntryTail() method lacks regression test coverage for its critical branches. Add two unit tests for this method: one test scenario where DirectoryCount equals zero to verify it returns all DirectoryEntries, and a second test scenario where DirectoryEntriesCount has a non-zero remainder when divided by DirectoryCount to verify that the remainder entries are correctly emitted by the Skip operation. These tests will ensure the extraction and repack logic remains stable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@OpenKh.Bbs/Bbsa.cs`:
- Around line 648-657: The GetDirectoryEntryTail() method lacks regression test
coverage for its critical branches. Add two unit tests for this method: one test
scenario where DirectoryCount equals zero to verify it returns all
DirectoryEntries, and a second test scenario where DirectoryEntriesCount has a
non-zero remainder when divided by DirectoryCount to verify that the remainder
entries are correctly emitted by the Skip operation. These tests will ensure the
extraction and repack logic remains stable.
This fixes extraction by including files that were not extracted previously, thus fixing repacking, too. Specifically this targets the HE_205.exa file in KH BBS FM PSP release.