Files
Aurora.3/code/unit_tests/zas_tests.dm
Lohikar f6dc33a465 Newmap - SMC, Openturf, Arrivals Controller, and Mine Turf Improvements (#1958)
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.

* this is probably important

* Remove cascade disabling SSgarbage

* Fixed a bug where dust() did not qdel the target mob

* Misc fixes

* Fix decals surviving break-to-plating

* Subsystem flag tweaks

* Apparently subsystems are new'd before config is.

* Fix paper icons

* Speculative fix for insane lag

* Better machinery stat

* Make organs not use SSoverlay

* Misc bugfixes & tweaks

* Nightmode fixes

* Changelog for SMC

* Port /tg/'s improved MC crash handling

* Add some more SS Recover() procs

* supply_controller -> SScargo

* More New() -> Initialize()

* pAI and robot construction overlays

* Fix cargo unit tests

* Merge the DMM Suite's atom/New() into atoms_init

* Lighting pre-baking

* Lighting initialization logging

* Fix some bad SS init orders

* Fix SSlighting logging; rename Processes to MC

* Speculative fix for insane GC lag

* Prebaked openturf/icon_smooth & fix lighting prebake

* SS init status; SSatoms LATEQDEL

* Fix bug with MC init stat panel

* Fix parallax

* Misc

* Ignore SS_NO_DISPLAY during init

* apparently this is important

* REEEEEE

* Image GC fixes; broadcaster radio-new sanity

* RCON Cleanup

* Move pAI recruiter into subsystem

* Move global solars list into sun subsystem

* Make chickens not use a global

* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup

* Speed up space init a little

* Fix bad timer flags on floor drying

* Subsystem panic-restart verb for mins

* Explosion speedup

* Minor subsystem & MC logging tweaks

* SSopenturf improvements

* Make pipenet actually initialize (whoops)

* Minor tweaks

* Implement lighting rounding

* comments are hard okay

* Minor lattice tweaks

* Fix some timer issues & better closet init

* Timer sanity

* Request console tweaks + Storage init sanity

* Minor SSmachiner RCON improvements

* Further reduce world-start timer count

* Standardize subsystem logging

* Garbage hard delete profiling from /tg/

* Timer hang detection & recovery

* Log machines that sleep in process() and fuck up SSmachinery

* Fix an issue with external airlocks sleeping in process()

* Failsafe logging

* Minor tweaks

* Revert "Request console tweaks + Storage init sanity"

This reverts commit 98d3579e35.

* Re-implement RC changes

* Fix SQL FT saving

* Fix SSmachinery sleep in disposals

* Minor SS tweaks

* Paper fixes

* Blood drying fixes

* Merge gameticker and SSticker

* Minor global list init cleanup

* Lagcheck biogenerator & bags

* Tweak SScargo init order; RIG Initialize()

* Caching tweaks

* Remove rogue comma

* Initialize fixes

* Lighting destroy cleanup

* Fix emagging airlocks

* Initial SSicon implementation

* Tweaks & Fixes

* Fire + Air alarm queued icon updates

* Overlays + Queued icon cleanup

* Runtime & background fixes

* Kill some meaningless set statements

* Kill some image qdels

* Bump up lighting rounding val

* Fix adv. scanner destroy runtimes

* Remove unneeded icon update limiting

* Move icon smoothing into helpers

* Show a warning if DM 510 compiles without memory leak hack enabled

* Re-organize subsystems & MC defines a little

* Airlock SFX

* Log of Changes

* Make SSicon_update disable itself when not doing anything

* Fix respawn verb runtime when used early in server-init

* Add more information to MC's stat_entry()

* Replace direct refernces to gcDestroyed with QDEL* macros

* plant_controller -> SSplants

* More plant tweaks

* Add more humor to changelog

* Move parallax globals into SSparallax

* Lighting responsiveness tweaks

* Fix parallax init order & better MC init panel stat

* Make mobs GC

* More overlays + Remove intercom spawn()

* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.

* Update changelog

* Mob GC tweaks

* Del() cleanup

* Fix insomniac ZAS connection edges

* Minor pAI cleanup

* Convert more things to SSoverlay; fix duplicated overlay in field gens

* SM Bluespace turf tweaks

* Update SSgarbage debug globals list

* Human-type qdel tweaks

* Subsystem suspension; stat_entry improvements

* SQL Statistics cleanup

* Fix runtimes with ambrosia

* More disable() -> suspend(); fix nightmode again

* Human qdel fix; minor tweaks

* Update turbolift to work with StonedMC

* Make lifts use timers instead of a subsystem

* Make SSassets start earlier

* Convert the radio controller into a subsystem

* Fix some missing CHECK_TICKs in asteroid generation

* MC stat tweaks; make shouldnt_see a typecache

* Kill some redundant debug-controller entries

* radio_controller -> SSradio

* Better SSgarbage hard-del logging from /tg/ upstream

* Logging tweaks + GELF

* Misc client caching improvements

* Slime SSoverlay

* Oven icon fixes

* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.

* Holder tweaks + Welding tool Initialize()

* Fix some bad subsystem logging

* Fix suit cooling units spawning without cells

* Starlight tweaks

* Gibber infinite gib fix

* More SSoverlay stuff

* Make crates use CUT_OVERLAY_IN

* Make SSarrivals suspend instead of disable

* Make openturf use split/phased tick checks

* Speculative fix for unwet timer runtimes

* Blood overlay tweaks/fixes

* Update crusher to play nice with SMC + SSoverlay

* Openturf improvements and fixes

* Minor turbolift tweaks

* Lighting performance improvements + ChangeTurf tweaks

* this is probably important

* Fix wall weld noises on changeturf

* More ChangeTurf tweaks

* Explosion tweaks

* Pre-game lobby tweaks

* Openturf tweaks

* Prevent admins from starting the game before init finishes

* Fix Travis

* Kill an unused var

* Fix ChangeTurf runtimes on openturfs

* Fixes

* Browser datum fixes, asset caching

* Update changelog

* Changelog

* Lobby tweaks

* Ticker tweaks; kill ticker var

* Further lobby tweaks

* Cascade tweaks

* air_master -> SSair

* Reduce overhead from radio autosay

* alarm_manager -> SSalarm

* bomb_processor -> SSexplosives

* corp_regs -> SSlaw

* ZAS overlay fixes

* Small wall icon optimization

* Fix effects master

* Assembly tweaks

* Megavend fixes

* Shuttle fixes

* Camera alert performance improvements

* Fix some world.log spam from lighting overlays

* Fix some Initialize() procs

* Openspace responsiveness tweaks

* Make HE pipes animate through openturfs

* Kill a spawn
2017-05-02 14:40:40 -04:00

237 lines
6.1 KiB
Plaintext

/*
*
* Zas Unit Tests.
* Shuttle Pressurized.
*
*
*/
#define UT_NORMAL 1 // Standard one atmosphere 20celsius
#define UT_VACUUM 2 // Vacume on simulated turfs
#define UT_NORMAL_COLD 3 // Cold but standard atmosphere.
#define UT_NORMAL_COOL 4 // Cool (5C) but standard atmosphere.
#define FAILURE 0
#define SUCCESS 1
//
// Generic check for an area.
//
datum/unit_test/zas_area_test
name = "ZAS: Area Test Template"
var/area_path = null // Put the area you are testing here.
var/expectation = UT_NORMAL // See defines above.
datum/unit_test/zas_area_test/start_test()
var/list/test = test_air_in_area(area_path, expectation)
if(isnull(test))
fail("Check Runtimed")
if(test["result"] == SUCCESS)
pass(test["msg"])
else
fail(test["msg"])
return 1
// ==================================================================================================
//
// The primary helper proc.
//
proc/test_air_in_area(var/test_area, var/expectation = UT_NORMAL)
var/test_result = list("result" = FAILURE, "msg" = "")
var/area/A = locate(test_area)
if(!istype(A, test_area))
test_result["msg"] = "Unable to get [test_area]"
return test_result
var/list/GM_checked = list()
for(var/turf/simulated/T in A)
if(!istype(T) || isnull(T.zone) || istype(T, /turf/simulated/floor/airless))
continue
if(T.zone.air in GM_checked)
continue
var/t_msg = "Turf: [T] | Location: [T.x] // [T.y] // [T.z]"
var/datum/gas_mixture/GM = T.return_air()
var/pressure = GM.return_pressure()
var/temp = GM.temperature
switch(expectation)
if(UT_VACUUM)
if(pressure > 10)
test_result["msg"] = "Pressure out of bounds: [pressure] | [t_msg]"
return test_result
if(UT_NORMAL || UT_NORMAL_COLD || UT_NORMAL_COOL)
if(abs(pressure - ONE_ATMOSPHERE) > 10)
test_result["msg"] = "Pressure out of bounds: [pressure] | [t_msg]"
return test_result
if(expectation == UT_NORMAL)
if(abs(temp - T20C) > 10)
test_result["msg"] = "Temperature out of bounds: [temp] | [t_msg]"
return test_result
if(expectation == UT_NORMAL_COLD)
if(temp > 120)
test_result["msg"] = "Temperature out of bounds: [temp] | [t_msg]"
return test_result
if(expectation == UT_NORMAL_COOL)
if(temp > 283)
test_result["msg"] = "Temperature out of bounds: [temp] | [t_msg]"
return test_result
GM_checked.Add(GM)
if(GM_checked.len)
test_result["result"] = SUCCESS
test_result["msg"] = "Checked [GM_checked.len] zones"
else
test_result["msg"] = "No zones checked."
return test_result
// ==================================================================================================
datum/unit_test/zas_area_test/supply_centcomm
name = "ZAS: Supply Shuttle (CentComm)"
area_path = /area/supply/dock
datum/unit_test/zas_area_test/emergency_shuttle
name = "ZAS: Emergency Shuttle"
area_path = /area/shuttle/escape/centcom
datum/unit_test/zas_area_test/ai_chamber
name = "ZAS: AI Chamber"
area_path = /area/turret_protected/ai
expectation = UT_NORMAL_COOL
datum/unit_test/zas_area_test/arrival_maint
name = "ZAS: Arrival Maintenance"
area_path = /area/maintenance/arrivals
datum/unit_test/zas_area_test/mining_shuttle_at_station
name = "ZAS: Mining Shuttle (Station)"
area_path = /area/shuttle/mining/station
disabled = 1
why_disabled = "This test has not been updated for newmap."
datum/unit_test/zas_area_test/
name = "ZAS: Cargo Maintenance"
area_path = /area/maintenance/cargo
datum/unit_test/zas_area_test/incinerator
name = "ZAS: Incinerator"
area_path = /area/maintenance/incinerator
disabled = 1
why_disabled = "Scrubber pulls air, this area cannot be tested."
datum/unit_test/zas_area_test/virology
name = "ZAS: Virology"
area_path = /area/medical/virology
datum/unit_test/zas_area_test/xenobio
name = "ZAS: Xenobiology"
area_path = /area/rnd/xenobiology
/* Hey, this area doesn't exist on the Aurora II.
datum/unit_test/zas_area_test/research_maint_starboard
name = "ZAS: Research Starboard Maintenance"
area_path = /area/maintenance/research_starboard
Nor does this one.
datum/unit_test/zas_area_test/west_hall_mining_outpost
name = "ZAS: Mining outpost West Hallway"
area_path = /area/outpost/mining_main/west_hall
*/
/*
datum/unit_test/zas_area_test/mining_area
name = "ZAS: Mining Area (Vacuum)"
area_path = /area/mine/explored
expectation = UT_VACUUM
disabled = 1
why_disabled = "Asteroid Generation disabled"
*/
datum/unit_test/zas_area_test/
name = "ZAS: Cargo Bay"
area_path = /area/quartermaster/storage
// ==================================================================================================
// Here we move a shuttle then test it's area once the shuttle has arrived.
datum/unit_test/zas_supply_shuttle_moved
name = "ZAS: Supply Shuttle (When Moved)"
async=1 // We're moving the shuttle using built in procs.
disabled = 1
why_disabled = "This test has not been updated for newmap."
var/datum/shuttle/ferry/supply/Shuttle = null
var/testtime = 0 //Used as a timer.
datum/unit_test/zas_supply_shuttle_moved/start_test()
if(!shuttle_controller || !shuttle_controller.shuttles.len)
fail("Shuttle Controller not setup at time of test.")
Shuttle = shuttle_controller.shuttles["Supply"]
SScargo.movetime = 5 // Speed up the shuttle movement.
if(isnull(Shuttle))
fail("Unable to locate the supply shuttle")
// Initiate the Move.
Shuttle.short_jump(Shuttle.area_offsite, Shuttle.area_station)
return 1
datum/unit_test/zas_supply_shuttle_moved/check_result()
if(Shuttle.moving_status == SHUTTLE_IDLE && !Shuttle.at_station())
fail("Shuttle Did not Move")
return 1
if(!Shuttle.at_station())
return 0
if(!testtime)
testtime = world.time+40 // Wait another 2 ticks then proceed.
if(world.time < testtime)
return 0
var/list/test = test_air_in_area(/area/supply/station)
if(isnull(test))
fail("Check Runtimed")
return 1
if(test["result"] == SUCCESS)
pass(test["msg"])
else
fail(test["msg"])
return 1
#undef UT_NORMAL
#undef UT_VACUUM
#undef UT_NORMAL_COLD
#undef UT_NORMAL_COOL
#undef SUCCESS
#undef FAILURE