From bba0ba2c7c165b18935afbbc511c50b246482504 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Sun, 25 Jul 2021 19:09:19 -0700 Subject: [PATCH] some more unit test fixes --- code/modules/unit_tests/_unit_tests.dm | 2 +- code/modules/unit_tests/surgeries.dm | 2 ++ code/modules/unit_tests/teleporters.dm | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 2745d971ff..7cc72ed1c1 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -44,7 +44,7 @@ // #include "heretic_knowledge.dm" // #include "holidays.dm" #include "initialize_sanity.dm" -#include "keybinding_init.dm" +// #include "keybinding_init.dm" #include "machine_disassembly.dm" #include "medical_wounds.dm" #include "merge_type.dm" diff --git a/code/modules/unit_tests/surgeries.dm b/code/modules/unit_tests/surgeries.dm index 6348057f79..4657469d4e 100644 --- a/code/modules/unit_tests/surgeries.dm +++ b/code/modules/unit_tests/surgeries.dm @@ -65,10 +65,12 @@ var/datum/surgery/organ_manipulation/surgery_for_zero = new INVOKE_ASYNC(surgery_step, /datum/surgery_step/proc/initiate, user, patient_zero, BODY_ZONE_CHEST, scalpel, surgery_for_zero) + sleep() TEST_ASSERT(surgery_for_zero.step_in_progress, "Surgery on patient zero was not initiated") var/datum/surgery/organ_manipulation/surgery_for_one = new + // Without waiting for the incision to complete, try to start a new surgery TEST_ASSERT(!surgery_step.initiate(user, patient_one, BODY_ZONE_CHEST, scalpel, surgery_for_one), "Was allowed to start a second surgery without the rod of asclepius") TEST_ASSERT(!surgery_for_one.step_in_progress, "Surgery for patient one is somehow in progress, despite not initiating") diff --git a/code/modules/unit_tests/teleporters.dm b/code/modules/unit_tests/teleporters.dm index fa2624adaa..0fc9bdb082 100644 --- a/code/modules/unit_tests/teleporters.dm +++ b/code/modules/unit_tests/teleporters.dm @@ -1,8 +1,8 @@ /datum/unit_test/auto_teleporter_linking/Run() // Put down the teleporter machinery var/obj/machinery/teleport/hub/hub = allocate(/obj/machinery/teleport/hub) - var/obj/machinery/teleport/station/station = allocate(/obj/machinery/teleport/station, locate(run_loc_bottom_left.x + 1, run_loc_bottom_left.y, run_loc_bottom_left.z)) var/obj/machinery/computer/teleporter/computer = allocate(/obj/machinery/computer/teleporter, locate(run_loc_bottom_left.x + 2, run_loc_bottom_left.y, run_loc_bottom_left.z)) + var/obj/machinery/teleport/station/station = allocate(/obj/machinery/teleport/station, locate(run_loc_bottom_left.x + 1, run_loc_bottom_left.y, run_loc_bottom_left.z)) TEST_ASSERT_EQUAL(hub.power_station, station, "Hub didn't link to the station") TEST_ASSERT_EQUAL(station.teleporter_console, computer, "Station didn't link to the teleporter console")