Add unit tests for AsyncLogWriter (#2497). Principle I.#2760
Merged
Conversation
Pins down the public-API behavior of AsyncLogWriter so future tightening of the PII redaction regexes (#2478) cannot regress without a test failing. Cases mirror the suggested set in the issue: - Line shape preservation ([HH:mm:ss.zzz] LVL cat: msg\n) for every QtMsgType label - IPv4 redaction, ver= exemption, and lock-in that quoted four-octet IPs are still redacted (per triage: quoting is not authentication of intent). The original "0.9.8" case was dropped as non-applicable (three octets never match the regex) and replaced with the explicit three-octet pass-through assertion. - Radio serial, id_token, MAC dash, and MAC colon redaction - clearLog truncates pre-clear lines and preserves post-clear lines - shutdown drains the queue (no loss on graceful stop) - Drop accounting under burst load (asserts inequalities since the worker drains concurrently; per triage open-question #2) - High-priority reserve keeps a critical line alive under a debug burst, and droppedHighPriorityLines stays at 0 - Stderr mirroring matches the file contents byte-for-byte when mirrorToStderr=true Test uses only the public API (no test-only hooks added to AsyncLogWriter), and routes the log path through QTemporaryDir so the suite does not litter /tmp. Blast radius: risk_score=0.000, 0 high-risk affected (AsyncLogWriter itself has self_betweenness=0; pure additive test + CMakeLists entry).
4 tasks
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
Fixes #2497
What was changed
Add unit tests for AsyncLogWriter (#2497). Principle I.
Files modified
CMakeLists.txttests/async_log_writer_test.cppGenerated by AetherClaude (automated agent for AetherSDR)