https://gitlab.synchro.net/main/sbbs/-/commit/a8af7bff4168067180b18e93
Added Files:
src/doors/clans-src/src/tests/mocks_alliance.h mocks_clansini.h mocks_door.h mocks_empire.h mocks_fight.h mocks_game.h mocks_help.h mocks_ibbs.h mocks_input.h mocks_items.h mocks_language.h mocks_mail.h mocks_news.h mocks_npc.h mocks_od.h mocks_quests.h mocks_readcfg.h mocks_spells.h mocks_system.h mocks_user.h mocks_video.h mocks_village.h
Modified Files:
src/doors/clans-src/docs/todo.txt src/doors/clans-src/src/tests/test_alliance.c test_clansini.c test_console.c test_empire.c test_fight.c test_ibbs.c test_items.c test_language.c test_maint.c test_misc.c test_myibbs.c test_myopen.c test_news.c test_parsing.c test_platform.c test_random.c test_readcfg.c test_scores.c test_semfile.c test_serialize.c test_tools.c
Log Message:
Complete todo [1.9]: Create shared mock headers for unit tests
Consolidate 500+ lines of duplicated test stub code into 21 reusable
header files (mocks_*.h). Each stub function now lives in exactly one
place, eliminating the need to edit every test file when a mocked
function signature changes.
Changes:
- Create 21 new mock headers (mocks_system.h, mocks_door.h, etc.)
covering all frequently-mocked modules (system, video, language,
door I/O, game state, input, etc.)
- Fix 7 headers with correct function signatures to match actual
declarations (critical: all signatures must be exact matches)
- Update all 22 test files to include appropriate mock headers
instead of defining stubs locally
- Exclude mocks_system.h from files that define their own
System_Error/CheckMem to avoid redefinition conflicts
- Remove completed todo item [1.9] from todo.txt
All 25 unit test suites compile cleanly and pass with optimized build.
Reduces test maintenance burden for future signature changes.
Co-Authored-By: Claude Haiku 4.5 <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net