diff --git a/_maps/templates/unit_tests.dmm b/_maps/templates/unit_tests.dmm index a3bb3f87471..72d1633d73d 100644 --- a/_maps/templates/unit_tests.dmm +++ b/_maps/templates/unit_tests.dmm @@ -3,15 +3,15 @@ /turf/closed/indestructible, /area/misc/testroom) "m" = ( -/turf/open/floor/iron, +/turf/open/indestructible, /area/misc/testroom) "r" = ( /obj/effect/landmark/unit_test_top_right, -/turf/open/floor/iron, +/turf/open/indestructible, /area/misc/testroom) "L" = ( /obj/effect/landmark/unit_test_bottom_left, -/turf/open/floor/iron, +/turf/open/indestructible, /area/misc/testroom) (1,1,1) = {" diff --git a/code/modules/unit_tests/baseturfs.dm b/code/modules/unit_tests/baseturfs.dm index 3cfe7c0f918..1041ac6da23 100644 --- a/code/modules/unit_tests/baseturfs.dm +++ b/code/modules/unit_tests/baseturfs.dm @@ -1,4 +1,4 @@ -#define EXPECTED_FLOOR_TYPE /turf/open/floor/iron +#define EXPECTED_FLOOR_TYPE /turf/open/floor // Do this instead of just ChangeTurf to guarantee that baseturfs is completely default on-init behavior #define RESET_TO_EXPECTED(turf) \ turf.ChangeTurf(EXPECTED_FLOOR_TYPE);\ @@ -6,6 +6,7 @@ /// Validates that unmodified baseturfs tear down properly /datum/unit_test/maptest_baseturfs_unmodified_scrape + normal_floor_required = TRUE /datum/unit_test/maptest_baseturfs_unmodified_scrape/Run() // What this is specifically doesn't matter, just as long as the test is built for it @@ -27,6 +28,7 @@ /// Validates that specially placed baseturfs tear down properly /datum/unit_test/maptest_baseturfs_placed_on_top + normal_floor_required = TRUE /datum/unit_test/maptest_baseturfs_placed_on_top/Run() TEST_ASSERT_EQUAL(run_loc_floor_bottom_left.type, EXPECTED_FLOOR_TYPE, "run_loc_floor_bottom_left should be an iron floor") @@ -46,6 +48,7 @@ /// Validates that specially placed baseturfs BELOW tear down properly /datum/unit_test/maptest_baseturfs_placed_on_bottom + normal_floor_required = TRUE /datum/unit_test/maptest_baseturfs_placed_on_bottom/Run() TEST_ASSERT_EQUAL(run_loc_floor_bottom_left.type, EXPECTED_FLOOR_TYPE, "run_loc_floor_bottom_left should be an iron floor") diff --git a/code/modules/unit_tests/mouse_bite_cable.dm b/code/modules/unit_tests/mouse_bite_cable.dm index df77976ce47..dc7fd04d24c 100644 --- a/code/modules/unit_tests/mouse_bite_cable.dm +++ b/code/modules/unit_tests/mouse_bite_cable.dm @@ -1,5 +1,6 @@ /// Unit Test to ensure that a mouse bites a cable, gets shocked, and dies. /datum/unit_test/mouse_bite_cable + normal_floor_required = TRUE /datum/unit_test/mouse_bite_cable/Run() // use dummy subtype that will bypass the probability check to bite on a cable diff --git a/code/modules/unit_tests/rcd.dm b/code/modules/unit_tests/rcd.dm index 49e9f8461fd..bdeb615c58e 100644 --- a/code/modules/unit_tests/rcd.dm +++ b/code/modules/unit_tests/rcd.dm @@ -8,6 +8,9 @@ * the test again on our turf containing our single frame, deconstructing the machines! This should also not spawn * any stacked machine frames. */ +/datum/unit_test/frame_stacking + normal_floor_required = TRUE + /datum/unit_test/frame_stacking/Run() // First test - RCDs stacking frames. var/obj/item/construction/rcd/rcd = allocate(/obj/item/construction/rcd/combat/admin) diff --git a/code/modules/unit_tests/spraycan.dm b/code/modules/unit_tests/spraycan.dm index 2ee4ab14454..1c46ffb54d9 100644 --- a/code/modules/unit_tests/spraycan.dm +++ b/code/modules/unit_tests/spraycan.dm @@ -1,5 +1,6 @@ /// Tests spray painting the ground to create graffiti. /datum/unit_test/spraypainting + normal_floor_required = TRUE /datum/unit_test/spraypainting/Run() var/mob/living/carbon/human/consistent/artist = EASY_ALLOCATE() diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm index f3773a4a9da..c381779b38a 100644 --- a/code/modules/unit_tests/unit_test.dm +++ b/code/modules/unit_tests/unit_test.dm @@ -59,6 +59,8 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) var/static/list/uncreatables = null /// Reference to the blank z-level containing our testing enviroment var/static/datum/space_level/reservation + /// If this unit test requires a normal turf to run. + var/normal_floor_required = FALSE /proc/cmp_unit_test_priority(datum/unit_test/a, datum/unit_test/b) return initial(a.priority) - initial(b.priority) @@ -69,7 +71,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) reservation = template.load_new_z() if(test_flags & UNIT_TEST_FOCUS) - warning("[src] has UNIT_TEST_FOCUS present inside var/test_flags.") + log_world("::error::[src] has UNIT_TEST_FOCUS present inside var/test_flags. This is a reminder to remove it from your commit!") // So CI fails. uncreatables ||= build_list_of_uncreatables() allocated = list() @@ -81,8 +83,11 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) return //Make sure that the top and bottom locations in the diagonal are floors. Anything else may get in the way of several tests. - TEST_ASSERT(isfloorturf(run_loc_floor_bottom_left), "run_loc_floor_bottom_left was not a floor ([run_loc_floor_bottom_left])") - TEST_ASSERT(isfloorturf(run_loc_floor_top_right), "run_loc_floor_top_right was not a floor ([run_loc_floor_top_right])") + TEST_ASSERT(isindestructiblefloor(run_loc_floor_bottom_left), "run_loc_floor_bottom_left was not an indestructable floor ([run_loc_floor_bottom_left])") + TEST_ASSERT(isindestructiblefloor(run_loc_floor_top_right), "run_loc_floor_top_right was not an indestructable floor ([run_loc_floor_top_right])") + if(normal_floor_required) + for(var/turf/open/turf in get_area_turfs(run_loc_floor_bottom_left.loc)) + turf.ChangeTurf(/turf/open/floor) /datum/unit_test/Destroy() QDEL_LIST(allocated) @@ -92,6 +97,9 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests()) if (istype(content, /obj/effect/landmark)) continue qdel(content) + if(normal_floor_required) + for(var/turf/open/turf in get_area_turfs(run_loc_floor_bottom_left.loc)) + turf.ChangeTurf(/turf/open/indestructible) return ..() /datum/unit_test/proc/Run()