mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 20:57:23 +01:00
[MIRROR] Circuitboard Unit Test (#12583)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Will
Cameron Lennox
parent
62e5df94a5
commit
7ddf404ce7
@@ -48,3 +48,28 @@
|
||||
|
||||
if(failed)
|
||||
TEST_FAIL("missing circuitboard print recipies.")
|
||||
|
||||
/datum/unit_test/all_default_circuits_must_match_machines
|
||||
|
||||
/datum/unit_test/all_default_circuits_must_match_machines/Run()
|
||||
var/failed = FALSE
|
||||
|
||||
// Check the machine deconstructs into the board
|
||||
for(var/obj/machinery/machine_path as anything in subtypesof(/obj/machinery))
|
||||
if((machine_path in typesof(/obj/machinery/airlock_sensor)) || (machine_path in typesof(/obj/machinery/embedded_controller/radio/airlock))) // Snowflake multi-type airlock board
|
||||
continue
|
||||
if(machine_path == /obj/machinery/power/smes) // Ignore this snowflake basetype that isn't constructable
|
||||
continue
|
||||
if(!machine_path.circuit)
|
||||
continue
|
||||
var/obj/item/circuitboard/board_path = initial(machine_path.circuit)
|
||||
if(!board_path)
|
||||
continue
|
||||
|
||||
// Get to the actual test!
|
||||
if(!(machine_path in typesof(board_path.build_path))) // This should be stricted someday... but not today.
|
||||
TEST_NOTICE(src, "[machine_path]'s default board does not match the machine it constructs. \"[board_path]\".")
|
||||
failed = TRUE
|
||||
|
||||
if(failed)
|
||||
TEST_FAIL("machine had an incorrect circuitboard in its definition.")
|
||||
|
||||
Reference in New Issue
Block a user