#define UT_NORMAL 1 #define UT_VACUUM 2 #define UT_NORMAL_COLD 3 /datum/unit_test/zas_area_test name = "ZAS: Area Test Template" var/area_path = null var/expectation = UT_NORMAL /datum/unit_test/zas_area_test/proc/test_air_in_area(var/test_area, var/expectation = UT_NORMAL) var/test_result = list("result" = 0, "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) || istype(T,/turf/simulated/shuttle/plating/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) 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 GM_checked.Add(GM) if(GM_checked.len) test_result["result"] = 1 test_result["msg"] = "Checked [GM_checked.len] zones" else test_result["msg"] = "No zones checked." return test_result /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"] == 1) pass(test["msg"]) else fail(test["msg"]) return 1