Repository navigation
Compile only the white-box tests without access control - #92
Merged
Merged
Conversation
Each test file that reached private members compiled whole with -fno-access-control. The tests that need it now sit in test_*_internals.cpp files of their own, beside the class's other tests, which compile with access control; the lines compiled without it fall from about 9.7k to 3.5k. Each flagged file's reason in tests/CMakeLists.txt names every private member it reaches. The three copies of the loop that wrapped a group's next pipeline job are one helper, group_job.h's wrap_job(), which yields between tries. Fixtures and harnesses a class's two files share move into headers, and hex.h replaces the hex helpers copied across the crypto tests. Two tests that reached a private member for no essential reason now use the public API instead.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in this test-only refactor; builds and tests were not run.
0 open findings
What changed in this PR
Narrows disabled access checks to dedicated white-box tests, addressing #43 without changing production code.
Changes:
- Separates private-member tests into
test_*_internals.cppfiles. - Shares fixtures and helpers, including job wrapping that yields between attempts.
- Updates compiler flags, access justifications, and testing documentation.
| File | Description |
|---|---|
| tests/trust_harness.h | Shares trust-test infrastructure. |
| tests/test_session.cpp | Uses shared harness and public queue API. |
| tests/test_session_internals.cpp | Isolates private buffer checks. |
| tests/test_session_driver.cpp | Uses public APIs and trace-based waits. |
| tests/test_session_driver_internals.cpp | Isolates stalled-write inspection. |
| tests/test_server_trust_internals.cpp | Isolates private trust-state tests. |
| tests/test_server_raw_client.cpp | Updates a comment's test-file reference. |
| tests/test_pairing_crypto.cpp | Retains public tests; shares hex helpers. |
| tests/test_pairing_crypto_internals.cpp | Isolates fixed-scalar tests. |
| tests/test_noise_initiator.cpp | Retains cipher-name tests. |
| tests/test_noise_initiator_internals.cpp | Isolates private-state vector tests. |
| tests/test_live_slew.cpp | Removes the private-state test. |
| tests/test_live_slew_internals.cpp | Isolates fallback checks using ramp input. |
| tests/test_host_view_internals.cpp | Isolates private slew and outbox checks. |
| tests/test_group_audio_internals.cpp | Isolates private pipeline checks. |
| tests/test_dispatcher.cpp | Retains public queue tests. |
| tests/test_dispatcher_internals.cpp | Isolates thread-token inspection. |
| tests/test_crypto.cpp | Reuses shared hex formatting. |
| tests/test_audio_workers.cpp | Retains public worker tests. |
| tests/test_audio_workers_internals.cpp | Isolates internal checks and yields during waits. |
| tests/session_harness.h | Shares session harness and fixture. |
| tests/host_view_fixture.h | Shares host-view fixture. |
| tests/hex.h | Consolidates hex conversion helpers. |
| tests/group_pipelines.h | Shares pipeline harness and assertions. |
| tests/group_job.h | Centralizes synchronized job wrapping. |
| tests/gate.h | Shares job synchronization helper. |
| tests/CMakeLists.txt | Restricts access-control flags to internals files. |
| src/ORIGIN.md | Updates test provenance documentation. |
| docs/conventions.md | Documents internals-file requirement. |
| CLAUDE.md | Documents shared helpers and testing rule. |
| .claude/skills/test-standards/SKILL.md | Updates access-control review checklist. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Only the tests that reach private members compile with
-fno-access-controlnow. They sit intest_*_internals.cppfiles beside each class's other tests, which compile with access control. The lines compiled without it fall from about 9.7k to 3.5k. The job-wrapping test helper exists once and yields between tries.Change
test_<x>.cppandtest_<x>_internals.cpp: audio_workers, dispatcher, group_audio, host_view, live_slew, noise_initiator, pairing_crypto, server_core, server_trust, session and session_driver.ctest -Nlists the same 829 tests, with the samerealtimeset.tests/CMakeLists.txtnames every private member it reaches, including those reached throughgroup_job.h.tests/group_job.h:wrap_job()waits, yielding, until a task is neither running nor queued, then replaces its job.pipelines_of()reads a group job'sGroupAudio.std::function::targetreach. The server_core copy waited only on!running_; it now also waits on!queued_, as the other two did.host_view_fixture.h,group_pipelines.h,session_harness.h,trust_harness.handgate.h.SessionTestis one fixture type, instantiated once intest_session.cpp.SessionTest.BecomesActiveWhenTheActivationIsTakenusesqueue_json_message().test_session_driver.cpp'sActiveDriverwaits until its trace's last event iswrittenwith nothing ready, rather than readingwriting_/waiting_.hex.hreplaces the hex helpers copied across the crypto and noise tests.DropsQueuedJobsWhenStopped's stop-wait yields.FallsBackToDroppedFramesKeepingTheAsrcbuilds a float ramp block rather than share the tone helper.CLAUDE.md,docs/conventions.mdand the test-standards checklist state the internals-file rule.CLAUDE.mdlists the new headers, andsrc/ORIGIN.mdnames both pairing-crypto files.Tests
No new tests; the existing ones are moved.
Closes #43