mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Circuitboard Unit Test (#19322)
* fix * updated test * types of * correct boards * fix those circuits * clarity * fix * try again * circuit test * Revert "fix those circuits" This reverts commitd4468d669a. * Revert "correct boards" This reverts commitb49b0d7f2e. * Reapply "fix those circuits" This reverts commit1189ee9524. * Reapply "correct boards" This reverts commitaf69adbfe8.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 50
|
||||
circuit = /obj/item/circuitboard/industrial_reagent_pump
|
||||
circuit = /obj/item/circuitboard/industrial_reagent_filter
|
||||
VAR_PROTECTED/filter_side = -1 // L
|
||||
VAR_PRIVATE/filter_reagent_id = ""
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "pumprelay"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
circuit = /obj/item/circuitboard/industrial_reagent_pump
|
||||
circuit = /obj/item/circuitboard/pump_relay
|
||||
|
||||
/obj/machinery/pump_relay/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -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