Commit 1db0137
Split UI test monolith into focused TUs
test_encryption_app.cpp was 1466 lines. Extract the three heaviest
test methods + one helper into their own translation units. All
methods remain on TestOpenCryptUI (declared in test_encryption_app.h)
so moc and test discovery continue to work unchanged.
tests/test_ui_encrypt_decrypt.cpp (new, 285 lines)
- testEncryptDecrypt
- encryptAndDecrypt helper
UI-driven single-file round-trip.
tests/test_ui_smoke.cpp (new, 194 lines)
- testTabSwitching
- testCryptoProviderSwitching
tests/test_ui_tamper.cpp (new, 89 lines)
- testTamperDetection
Engine-level coverage lives in test_engine_tamper.cpp;
this drives the same flow via real widgets.
tests/test_ui_common.h (new, 30 lines)
Shared Qt + engine include block so each test_ui_*.cpp file
starts with a single #include instead of repeating 20 lines.
tests/test_encryption_app.cpp: 1466 → 914 lines. Still the largest
test TU but now sits below the 1000-line threshold and contains
only init/cleanup/helpers + the small QSKIP'd / conditionally-
skipped tests.
Verified: ctest -j 4 reports 100% (9/9 in 41 s).
No files in src/, include/, or tests/ exceed 1000 lines now:
914 tests/test_encryption_app.cpp
837 src/mainwindow_disk.cpp
800 src/encryptionengine_keyderivation.cpp
705 src/encryptionengine_crypto.cpp
668 src/mainwindow.cpp
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0997104 commit 1db0137
6 files changed
Lines changed: 607 additions & 557 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| |||
0 commit comments