Skip to content

S24.10: rename file-leaking identifiers and comments in BlockStore tests #449

Description

@DavidCozens

Context

Audit on 2026-05-25 found that the *Block* production code is clean —
BlockStore / BlockDevice / BlockSequence consistently use block-layer
nouns, with FileBlockDevice correctly isolated as the one file-backed
adapter.

The BlockStore tests, however, leak file / File naming at the
fixture surface, in test names, and in inline comments. This perpetuates
the smell flagged in the project memory and makes readers think the tests
are exercising file I/O when they're verifying the BlockStore abstraction
over an injected BlockDevice.

Parent epic: #254

Scope

Three test files, no production changes:

  • Tests/SolidSyslogBlockStoreTest.cpp (~97 occurrences)

    • Fixture member struct SolidSyslogFile* file in BlockDeviceTestBase
      (L70) → rename to device / blockDevice.
    • ~13 test names containing File/Files in the Rotation, Discard,
      and Resume groups (L122, L407, L731, L739, L755, L773, L795, L813,
      L877, L995, L1006, L1034, etc.) → rename to use Block.
    • ~30 /* file 00 */ … /* file 02 */ block-index comments across
      rotation/discard/resume tests → /* block NN */.
    • /* Resume from existing file */ (L310), /* File rotation */ (L684)
      comment headers.
  • Tests/SolidSyslogBlockStorePosixTest.cpp

    • Fixture member file (L40) → device / blockDevice.
    • Test name DiscardOldestWhenReadIsPartwayThroughOldestFile (L112)
      …OldestBlock.
    • ~10 /* file NN */ block-index comments (L87, 91, 93, 126, 130, 134,
      141, 144) → /* block NN */.
    • Leave CleanStoreFiles() (L15) and the L29–31 "real POSIX files"
      doc-comment alone — those describe what the integration test actually
      does on disk.
  • Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp

    • Fixture member file and fileStorage (L116, L123).
    • Comment header /* Shared file / block-device / … */ (L107).

Out of scope: production code (already clean), FileBlockDevice tests
(file is the right noun there), and BlockSequence/BlockDevice/NullBlockDevice
tests (already clean).

Done when

  • All *Block* test files use block-layer nouns at the fixture surface
    and in test names; file survives only where the concrete SolidSyslogFile
    handle is being constructed.
  • Block-index comments say block not file.
  • All tests still green under cmake --build --preset debug --target junit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions