Files
Bubberstation/code/modules/unit_tests/initialize_sanity.dm
SkyratBot 2cf928b280 [MIRROR] Init sanity unit test (#1980)
* Init sanity unit test (#55147)

https://github.com/tgstation/TerraGov-Marine-Corps/pull/5326
Stemming from
https://github.com/ParadiseSS13/Paradise/pull/14770

Basically it just checks for bad initialize calls

* Init sanity unit test

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2020-11-30 23:01:45 +00:00

12 lines
575 B
Plaintext

/datum/unit_test/initialize_sanity/Run()
if(length(SSatoms.BadInitializeCalls))
Fail("Bad Initialize() calls detected. Please read logs.")
var/list/init_failures_to_text = list(
"[BAD_INIT_QDEL_BEFORE]" = "Qdeleted Before Initialized",
"[BAD_INIT_DIDNT_INIT]" = "Did Not Initialize",
"[BAD_INIT_SLEPT]" = "Initialize() Slept",
"[BAD_INIT_NO_HINT]" = "No Initialize() Hint Returned",
)
for(var/failure in SSatoms.BadInitializeCalls)
log_world("[failure]: [init_failures_to_text["[SSatoms.BadInitializeCalls[failure]]"]]") // You like stacked brackets?