Skip to content

Commit

Permalink
Adds a Unit Test for Turf Sound Sanity (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
RimiNosha authored Dec 20, 2023
1 parent 2c6bd3e commit 5045fba
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/modules/overmap/planets/planet_types/barren_planet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
icon = 'icons/planet/barren/barren_floor.dmi'
icon_state = "barren"
base_icon_state = "barren"
footstep = FOOTSTEP_GENERIC_HEAVY
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_GENERIC_HEAVY

/turf/open/misc/planetary/chlorine_sand/Initialize()
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_GENERIC_HEAVY

/turf/open/misc/planetary/shrouded_sand/Initialize()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/overmap/planets/planetary_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
footstep = FOOTSTEP_SAND
barefootstep = FOOTSTEP_SAND
clawfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_SAND
heavyfootstep = FOOTSTEP_GENERIC_HEAVY

/turf/open/misc/planetary/sand/Initialize()
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
#include "tgui_create_message.dm"
#include "timer_sanity.dm"
#include "traitor.dm"
#include "turf_sound.dm"
#include "unit_test.dm"
#include "wizard_loadout.dm"
// END_INCLUDE
Expand Down
19 changes: 19 additions & 0 deletions code/modules/unit_tests/turf_sound.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Goes through every subtype of /turf/open and makes sure a valid step type exists for each category.
*/
/datum/unit_test/turf_sound

/datum/unit_test/turf_sound/Run()
for(var/turf/open/turf_to_check as anything in subtypesof(/turf/open))
var/footstep = initial(turf_to_check.footstep)
var/barefootstep = initial(turf_to_check.barefootstep)
var/clawfootstep = initial(turf_to_check.clawfootstep)
var/heavyfootstep = initial(turf_to_check.heavyfootstep)
if(footstep && !GLOB.footstep[footstep])
TEST_FAIL("Footstep for [turf_to_check] is not a valid entry, check \"code/__DEFINES/footsteps.dm\" for valid values.")
if(barefootstep && !GLOB.barefootstep[barefootstep])
TEST_FAIL("Barefootstep for [turf_to_check] is not a valid entry, check \"code/__DEFINES/footsteps.dm\" for valid values.")
if(clawfootstep && !GLOB.clawfootstep[clawfootstep])
TEST_FAIL("Clawfootstep for [turf_to_check] is not a valid entry, check \"code/__DEFINES/footsteps.dm\" for valid values.")
if(heavyfootstep && !GLOB.heavyfootstep[heavyfootstep])
TEST_FAIL("Heavyfootstep for [turf_to_check] is not a valid entry, check \"code/__DEFINES/footsteps.dm\" for valid values.")

0 comments on commit 5045fba

Please sign in to comment.