[MIRROR] Smes validity test (#12442)

Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-02-22 23:04:42 +01:00
committed by GitHub
co-authored by Will Kashargul
parent 9288d7f617
commit 413b37e939
3 changed files with 30 additions and 13 deletions
+24 -7
View File
@@ -207,15 +207,32 @@
/datum/unit_test/ladder_test/Run()
for(var/obj/structure/ladder/L in world)
var/turf/T = get_turf(L)
TEST_ASSERT(T, "[L.x].[L.y].[L.z]: Map - Ladder on invalid turf")
if(!T)
TEST_FAIL("[L.x].[L.y].[L.z]: Map - Ladder on invalid turf")
continue
if(L.allowed_directions & UP)
if(!L.target_up)
TEST_FAIL("[T.x].[T.y].[T.z]: Map - Ladder allows upward movement, but had no ladder above it")
TEST_ASSERT(L.target_up, "[T.x].[T.y].[T.z]: Map - Ladder allows upward movement, but had no ladder above it")
if(L.allowed_directions & DOWN)
if(!L.target_down)
TEST_FAIL("[T.x].[T.y].[T.z]: Map - Ladder allows downward movement, but had no ladder beneath it")
if(T.density)
TEST_FAIL("[L.x].[L.y].[L.z]: Map - Ladder is inside a wall")
TEST_ASSERT(L.target_down, "[T.x].[T.y].[T.z]: Map - Ladder allows downward movement, but had no ladder beneath it")
TEST_ASSERT(!T.density, "[L.x].[L.y].[L.z]: Map - Ladder is inside a wall")
/// Test the smes on the map
/datum/unit_test/smes_validity
/datum/unit_test/smes_validity/Run()
var/failed = FALSE
var/list/used_tags = list()
for(var/obj/machinery/power/smes/buildable/unit in world)
if(unit.RCon_tag == initial(unit.RCon_tag))
continue
if(unit.RCon_tag in used_tags)
TEST_NOTICE(src, "[unit.x].[unit.y].[unit.z]: Map - Smes has an already used RCon_tag: \"[unit.RCon_tag]\"")
failed = TRUE
continue
used_tags += unit.RCon_tag
if(failed)
TEST_FAIL("Map has smes with duplicated RCon_tag")