mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2026-08-25 13:46:46 +01:00
unit test
this is the easy part, believe it or not
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
break
|
||||
mobloc = default_mobloc
|
||||
if(!mobloc)
|
||||
Fail("Unable to find a location to create test mob")
|
||||
TEST_FAIL("Unable to find a location to create test mob")
|
||||
return FALSE
|
||||
|
||||
var/mob/living/carbon/human/H = new mobtype(mobloc)
|
||||
@@ -44,7 +44,7 @@
|
||||
endOxyloss = H.getOxyLoss()
|
||||
|
||||
if(!startOxyloss < endOxyloss)
|
||||
Fail("Human mob is not taking oxygen damage in space. (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
TEST_FAIL("Human mob is not taking oxygen damage in space. (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
|
||||
qdel(H)
|
||||
return 1
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
// Now that pred belly exists, we can eat the prey.
|
||||
if(!pred.vore_selected)
|
||||
Fail("[pred] has no vore_selected.")
|
||||
TEST_FAIL("[pred] has no vore_selected.")
|
||||
return TRUE
|
||||
|
||||
// Attempt to eat the prey
|
||||
@@ -82,7 +82,7 @@
|
||||
pred.vore_selected.nom_mob(prey)
|
||||
|
||||
if(prey.loc != pred.vore_selected)
|
||||
Fail("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
TEST_FAIL("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
return TRUE
|
||||
|
||||
// Okay, we succeeded in eating them, now lets wait a bit
|
||||
@@ -96,7 +96,7 @@
|
||||
// Alright lets check it!
|
||||
endOxyloss = prey.getOxyLoss()
|
||||
if(startOxyloss < endOxyloss)
|
||||
Fail("Prey takes oxygen damage in a pred's belly! (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
TEST_FAIL("Prey takes oxygen damage in a pred's belly! (Before: [startOxyloss]; after: [endOxyloss])")
|
||||
qdel(prey)
|
||||
qdel(pred)
|
||||
return TRUE
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
// Now that pred belly exists, we can eat the prey.
|
||||
if(!pred.vore_selected)
|
||||
Fail("[pred] has no vore_selected.")
|
||||
TEST_FAIL("[pred] has no vore_selected.")
|
||||
return TRUE
|
||||
|
||||
// Attempt to eat the prey
|
||||
@@ -136,12 +136,12 @@
|
||||
pred.vore_selected.nom_mob(prey)
|
||||
|
||||
if(prey.loc != pred.vore_selected)
|
||||
Fail("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
TEST_FAIL("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
return TRUE
|
||||
else
|
||||
var/turf/T = locate(/turf/open/space)
|
||||
if(!T)
|
||||
Fail("could not find a space turf for testing")
|
||||
TEST_FAIL("could not find a space turf for testing")
|
||||
return TRUE
|
||||
else
|
||||
pred.forceMove(T)
|
||||
@@ -159,7 +159,7 @@
|
||||
endOxyloss = prey.getOxyLoss()
|
||||
endBruteloss = prey.getBruteLoss()
|
||||
if(startBruteloss < endBruteloss)
|
||||
Fail("Prey takes brute damage in space! (Before: [startBruteloss]; after: [endBruteloss])")
|
||||
TEST_FAIL("Prey takes brute damage in space! (Before: [startBruteloss]; after: [endBruteloss])")
|
||||
qdel(prey)
|
||||
qdel(pred)
|
||||
return TRUE
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
// Now that pred belly exists, we can eat the prey.
|
||||
if(!pred.vore_selected)
|
||||
Fail("[pred] has no vore_selected.")
|
||||
TEST_FAIL("[pred] has no vore_selected.")
|
||||
return TRUE
|
||||
|
||||
// Attempt to eat the prey
|
||||
@@ -197,7 +197,7 @@
|
||||
pred.vore_selected.nom_mob(prey)
|
||||
|
||||
if(prey.loc != pred.vore_selected)
|
||||
Fail("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
TEST_FAIL("[pred.vore_selected].nom_mob([prey]) did not put prey inside [pred]")
|
||||
return TRUE
|
||||
|
||||
// Okay, we succeeded in eating them, now lets wait a bit
|
||||
@@ -212,7 +212,7 @@
|
||||
// Alright lets check it!
|
||||
endBruteBurn = prey.getBruteLoss() + prey.getFireLoss()
|
||||
if(startBruteBurn >= endBruteBurn)
|
||||
Fail("Prey doesn't take damage in digesting belly! (Before: [startBruteBurn]; after: [endBruteBurn])")
|
||||
TEST_FAIL("Prey doesn't take damage in digesting belly! (Before: [startBruteBurn]; after: [endBruteBurn])")
|
||||
qdel(prey)
|
||||
qdel(pred)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user