• src/doors/clans-src/src/t

    From Deuc¿@VERT to Git commit to main/sbbs/m on Saturday, November 01, 2025 14:28:00
    https://gitlab.synchro.net/main/sbbs/-/commit/4f1774cb9c7a4e18af062e7a
    Added Files:
    src/doors/clans-src/src/tools.c tools.h
    Log Message:
    Add missing files from the conversion work

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 08, 2026 11:43:00
    https://gitlab.synchro.net/main/sbbs/-/commit/3b2e03a8f72ea1b3ad5d7e52
    Added Files:
    src/doors/clans-src/src/tests/GNUmakefile test_alliance.c test_clansini.c test_console.c test_empire.c test_fight.c test_harness.h 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_npc.c test_parsing.c test_platform.c test_random.c test_readcfg.c test_scores.c test_semfile.c test_serialize.c test_spells.c test_tools.c test_user.c
    Log Message:
    Another thing I'm too lazy for is unit tests.

    Here's some to establish a baseline, but really they should be
    created when I'm about the refactor something or when I think
    something is broken. It's kinda pointless to write them now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Wednesday, March 11, 2026 14:56:00
    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
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Wednesday, March 11, 2026 14:56:00
    https://gitlab.synchro.net/main/sbbs/-/commit/b25efb4ba2a01c7dcb6d1ed0
    Modified Files:
    src/doors/clans-src/src/tests/GNUmakefile src/doors/clans-src/tests/GNUmakefile
    Log Message:
    Add missing build dependencies to test GNUmakefiles

    tests/GNUmakefile: Add order-only devkit prerequisite to ensure all devkit binaries (langcomp, ecomp, mcomp, etc.) are built before running the ten integration test shell scripts. This fixes "No rule to make" errors after
    gmake deepclean.

    src/tests/GNUmakefile: Add a forwarding rule for ../mstrings.h that delegates to src/GNUmakefile. Unit tests that depend on this auto-generated file will
    now regenerate it if missing, preventing "No rule to make target" errors on fresh checkout.

    Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Thursday, March 12, 2026 15:23:00
    https://gitlab.synchro.net/main/sbbs/-/commit/28aaaca6e08e6b38f1b1586f
    Added Files:
    src/doors/clans-src/src/tests/test_config.c test_quests.c test_reg.c test_reset.c
    Modified Files:
    src/doors/clans-src/CLAUDE.md src/doors/clans-src/docs/testability.md src/doors/clans-src/src/tests/GNUmakefile test_platform.c
    Log Message:
    Add comprehensive unit tests for pure functions in testability.md

    Created four new test suites covering 46 test cases for pure functions:
    - test_platform.c: Extended with 20 tests for IsLeapYear, DaysSinceJan1,
    FileName, FreeFileList, fullpath (54 total tests)
    - test_quests.c: 11 tests for ClearFlags, SetFlag, ClearFlag, FlagSet
    - test_reset.c: 6 tests for InitEmpire, GenerateGameID, ClearFlags
    - test_config.c: 4 tests for MailerTypeName
    - test_reg.c: 5 tests for Jumble and IsRegged (empty/wrong code branches)

    Fixed testability.md errors:
    - user.c GetClanNameID: marked Disk Read = Y (fopen/fseek/fread)
    - unix_wrappers.c fullpath: marked Disk Read = Y (getcwd filesystem access)

    Added bug-handling rule to CLAUDE.md: when potential bugs are found during unrelated tasks, pause to ask user to Ignore, add to ToDo, or Chat about it. All work continues after decision.

    All unit tests pass (29 binaries, 300+ tests).
    Integration tests pass (115/115).

    Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Saturday, March 14, 2026 21:36:00
    https://gitlab.synchro.net/main/sbbs/-/commit/04435dcc644a3b23c1be8c2e
    Added Files:
    src/doors/clans-src/src/tests/mocks_platform.h
    Modified Files:
    src/doors/clans-src/docs/functions.md testability.md src/doors/clans-src/src/alliancem.c chew.c clans.c clansini.c defines.h door.c ecomp.c empire.c help.c ibbs.c input.c install.c items.c makenpc.c mclass.c mcomp.c mitems.c mspells.c myibbs.c myopen.c news.c npc.c platform.c platform.h qtest.c quests.c readcfg.c reg.c reset.c scores.c semfile.c system.c src/doors/clans-src/src/tests/test_console.c test_maint.c test_news.c test_semfile.c src/doors/clans-src/src/unix_wrappers.c unix_wrappers.h user.c video.c video.h village.c win_wrappers.c win_wrappers.h
    Log Message:
    Wrap all non-C17 calls behind platform abstraction layer

    Create plat_stricmp (wraps strcasecmp/stricmp), plat_fsopen (wraps
    _fsopen), plat_CreateSemfile (NFS-safe on Unix, fopen "w+x" elsewhere), plat_mkdir, plat_GetExePath, plat_getmode, and plat_chmod. Move
    DirExists from platform.c into the per-platform wrapper files.

    Replace all 116 strcasecmp call sites with plat_stricmp. Replace all _fsopen/_SH_DENY* call sites with plat_fsopen/PLAT_SH_DENY*. Replace
    MKDIR macro, GetModuleFileName/fullpath exe-path logic, stat()-based
    permission capture (chew.c), and chmod()-based permission restore
    (install.c) with platform wrappers.

    On Windows, add a real strdup() function (conditional on C < C23) to
    replace the old #define macro. Remove stale #includes from myibbs.c.

    Eliminate all #ifndef __unix__ and #ifdef __unix__...#else patterns;
    replace with explicit platform guards so new ports don't silently get
    wrong behavior. Simplify FAR macro to default empty unless __MSDOS__.

    Update docs/functions.md with ~60 previously undocumented functions
    (fight.c second half, empire.c first half, user.c first half, new
    platform wrappers). Update docs/testability.md with new sections,
    corrected D/T markings, and clarified Non-C17 column rules.

    Refactor test_semfile.c to use mock-driven plat_CreateSemfile instead
    of real filesystem operations. Add mocks_platform.h shared test stubs.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 15, 2026 01:06:00
    https://gitlab.synchro.net/main/sbbs/-/commit/0789b4c20f98b25184ae6a26
    Modified Files:
    src/doors/clans-src/src/tests/test_empire.c test_fight.c test_items.c test_spells.c
    Log Message:
    Add unit tests for pure functions across items, fight, empire, spells

    items.c (8 new, 25 total): GetEquippableItem (type filtering, book/scroll exclusion, all-equipped sentinel), UnequipItemsFromPC (PClan global
    mutation, Available guard, no-match).

    fight.c (19 new, 41 total): FirstAvailable (empty, skip dead, last slot), CanRun (deterministic strong/weak, undead exclusion, empty clans),
    RemoveUndead (selective free+NULL), Fight_IsIncapacitated (spell flag
    check with SF_INCAPACITATE, combined flags), Fight_ManaRegenerate
    (already-max no-op, increases SP, caps at MaxSP, zero-wisdom minimum).

    empire.c (9 new, 32 total): Empire_Create (user/NPC/ClanEmpires-off), ArmyAttack (attacker wins, defender wins, empty attacker/defender,
    casualty tracking, equal forces).

    spells.c (8 new, 12 total): Spells_UpdatePCSpells (energy reduction, strength/wisdom stat reduction on hostile spells, friendly immunity,
    wearoff output + deactivation, inactive slot skip, multiple spells).

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net