Skip to content

Commit 1db0137

Browse files
bramclaude
andcommitted
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

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
199199
set(TEST_SOURCES
200200
tests/main.cpp
201201
tests/test_encryption_app.cpp
202+
tests/test_ui_encrypt_decrypt.cpp
203+
tests/test_ui_smoke.cpp
204+
tests/test_ui_tamper.cpp
205+
tests/test_ui_common.h
202206
)
203207

204208
# Create test executable

0 commit comments

Comments
 (0)