ModernUO/Projects/UOContent.Tests/Tests/Mobiles/AI
Robert Dickey 9d9e672a09
fix(ai): make debug-message cooldown comparisons wraparound-safe (#2659)
When an AI debug-message cooldown crosses the signed tick-counter boundary, DebugInterpolatedStringHandler can emit before the deadline or suppress a message after it. Both constructors compare absolute tick values.

Use subtraction-based deadline comparisons in both constructors, following dev-docs/tick-counts.md. This is a two-line production change; message formatting, cooldown duration, and gameplay behavior are unchanged.

Adds 35 regression cases exercising the actual handler and DebugSayFormatted:
- Both constructor overloads, with debugging enabled and disabled.
- Before/at/after deadlines on positive and negative clocks.
- Future and expired deadlines across signed wraparound.
- Cooldown rearming across wraparound and buffer clearing.
- A compiler-generated interpolated call through the public extension method.

Validation on Linux / .NET 10, based on clean upstream 35e3a31b4:
- Release build: 0 warnings, 0 errors.
- New tests against unchanged production code: 28 passed, 7 failed.
- With the fix: 35 passed, including without client map data (no skips).
- Selected AI/pet suites: 134 passed / 7 failed before; 141 passed / 0 failed after.

Tests use synthetic entities; no running shard or world saves. The faulty comparisons were reverified on upstream main before submission. Windows execution remains unverified. The tests exercise explicitly assigned deadlines; deadline initialization is outside this patch.

Addresses only the DebugInterpolatedStringHandler comparison item in #2627; it does not close the other audit items.
2026-09-19 09:59:00 -07:00
..
AcquisitionTests.cs feat: event-driven target acquisition with a reaction-time gradient (#2601) 2026-09-01 20:42:15 -07:00
AIDeactivationTests.cs fix: handle null maps when deactivating creature AI (#2629) 2026-09-11 17:26:47 -07:00
ApproachOutcomeTests.cs fix(ai): FamiliarAI owns familiar movement and combat; herding reaches its tile; ForcedAI read once (#2644) 2026-09-14 23:14:30 -07:00
ApproachTargetTests.cs fix(ai): FamiliarAI owns familiar movement and combat; herding reaches its tile; ForcedAI read once (#2644) 2026-09-14 23:14:30 -07:00
DebugMessageTimingTests.cs fix(ai): make debug-message cooldown comparisons wraparound-safe (#2659) 2026-09-19 09:59:00 -07:00
FamiliarAITests.cs fix(ai): FamiliarAI owns familiar movement and combat; herding reaches its tile; ForcedAI read once (#2644) 2026-09-14 23:14:30 -07:00
ForcedAITests.cs fix(ai): FamiliarAI owns familiar movement and combat; herding reaches its tile; ForcedAI read once (#2644) 2026-09-14 23:14:30 -07:00
GuardFollowTests.cs fix: pets freeze, forget their orders, obey the wrong players, and fight when told not to (#2614) 2026-09-10 19:28:13 -07:00
GuardOrderTests.cs fix: pet obedience pacing, stale AI wake rescheduling, and Guard order persistence through combat (#2594) 2026-08-30 16:39:29 -07:00
HerdingTests.cs fix(ai): FamiliarAI owns familiar movement and combat; herding reaches its tile; ForcedAI read once (#2644) 2026-09-14 23:14:30 -07:00
MoveSpeedTests.cs refactor: Changes BaseCreature to the SerializationGenerator (delta save requirement) (#2611) 2026-09-06 14:11:51 -07:00
PetOrderTests.cs fix(ai): wild creatures no longer stand down when attacked (#2645) 2026-09-14 23:18:11 -07:00
PetPacingTests.cs fix: pets freeze, forget their orders, obey the wrong players, and fight when told not to (#2614) 2026-09-10 19:28:13 -07:00
PetRetaliationTests.cs fix(ai): wild creatures no longer stand down when attacked (#2645) 2026-09-14 23:18:11 -07:00
PetTestStub.cs fix: pets freeze, forget their orders, obey the wrong players, and fight when told not to (#2614) 2026-09-10 19:28:13 -07:00
RunFlagTests.cs feat: derive the Running bit from the step pace and fix step-pacing bursts (#2599) 2026-08-30 16:48:52 -07:00