Commit graph

5 commits

Author SHA1 Message Date
Kelsi
f76aebc4b9 test(objects): add load-time clamp + uniqueId round-trip tests
- ObjectPlacer load: scale=0 clamped to 1.0, missing scale field
  defaults to 1.0 (locks in the load-side guard at line 346).
- ObjectPlacer save→load: uniqueId values survive a full round
  trip (locks in the explicit uniqueId preservation behavior the
  ADT round-trip relies on).

Adds object_placer.cpp to test_editor_units sources.
2026-05-06 09:40:06 -07:00
Kelsi
9d37da45d8 test(wcp): add truncation detection test
Locks in the recent unpack truncation guard. Hand-writes a WCP
that declares dataSize=1000 but only ships 50 bytes; verifies
the unpack returns false AND that no partial file landed on disk.
2026-05-06 08:13:43 -07:00
Kelsi
2400271a4f test(brush): add 6 EditorBrush::getInfluence tests
Locks in the recent NaN/zero-radius/zero-falloff guards:
- inner radius returns full influence (1.0)
- at/beyond outer radius returns 0
- rim falls off as 1 - t² (smooth)
- NaN/inf distance rejected (returns 0, not 1 from short-circuit)
- zero/negative/NaN radius rejected
- zero falloff produces hard-edge brush
2026-05-06 08:05:43 -07:00
Kelsi
d03c96e3bd test(wcp): add unpack security tests
6 tests covering ContentPacker::unpackZone defenses:
- absurd fileCount header rejected
- absurd infoSize header rejected (16MB cap)
- relative path traversal ('../../etc/passwd_clone') rejected
- absolute paths ('/tmp/...') rejected
- malicious zone name slugified instead of escaping destDir
- bad magic rejected

Each test confirms the defense fires AND that no escape file
landed outside the test dir.
2026-05-06 08:03:02 -07:00
Kelsi
ad65b2ad36 test(editor): add 4 quest validateChains tests + rename to test_editor_units
Tests cover:
- non-existent nextQuestId is flagged
- orphan quests (no questgiver, no turn-in) are flagged
- turn-in only quest is accepted (auto-completed quest pattern)
- circular chain is detected

Renamed test_sql_escape → test_editor_units since the file now
houses both SQL escape and quest validation tests.
2026-05-06 07:49:26 -07:00