Skip to content

Commit

Permalink
Simplify unit test dummy mob creation
Browse files Browse the repository at this point in the history
  • Loading branch information
out-of-phaze committed Jan 21, 2025
1 parent f083257 commit 417cfbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 2 additions & 10 deletions code/unit_tests/equipment_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@
async = 1

/datum/unit_test/vision_glasses/start_test()
var/mob/living/human/subject = new(get_safe_turf(), SPECIES_HUMAN) // force human so default map species doesn't mess with anything
var/list/test = create_test_mob_with_mind(get_safe_turf(), /mob/living/human)

Check failure on line 11 in code/unit_tests/equipment_tests.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

undefined proc: "create_test_mob_with_mind" on /datum/unit_test/vision_glasses
if(isnull(test))
fail("Check Runtimed in Mob creation")

if(test["result"] == FAILURE)
fail(test["msg"])
async = 0
return 0

H = locate(test["mobref"])
H.equip_to_slot(new glasses_type(H), slot_glasses_str)
subject.equip_to_slot(new glasses_type(subject), slot_glasses_str)
return 1

/datum/unit_test/vision_glasses/check_result()
Expand Down
4 changes: 1 addition & 3 deletions code/unit_tests/mob_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@

// ============================================================================

var/global/default_mobloc = null

/proc/create_test_mob_with_mind(var/turf/mobloc, var/mobtype = /mob/living/human)
/datum/unit_test/mob_damage/proc/create_test_mob_with_mind(var/turf/mobloc, var/mobtype = /mob/living/human)
var/list/test_result = list("result" = FAILURE, "msg" = "", "mobref" = null)

if(!mobloc)
Expand Down

0 comments on commit 417cfbe

Please sign in to comment.