Permalink
Browse files

Added per-map unit testing exceptions for apc/scrubbers/vents check.

  • Loading branch information...
MistakeNot4892 committed Feb 2, 2019
1 parent 39fb0c6 commit baba76b642b0f9fec92241c9c42b66ced4128a59
@@ -40,7 +40,7 @@ SUBSYSTEM_DEF(materials)
. = ..()

/datum/controller/subsystem/materials/proc/get_material_by_name(name)
if(!name || name == "")
if(!name)
return null
if(!materials_by_name)
build_material_lists()
@@ -5,22 +5,20 @@
gender = PLURAL
var/material/material = MATERIAL_GLASS

/obj/item/clothing/ears/earring/New(var/newloc, var/new_material)
..(newloc)
/obj/item/clothing/ears/earring/Initialize(var/mapload, var/new_material)
. = ..(mapload)
if(!new_material)
if(ispath(material))
new_material = material
else
new_material = MATERIAL_GLASS
material = SSmaterials.get_material_by_name(new_material)
if(!istype(material))
qdel(src)
return
return INITIALIZE_HINT_QDEL
name = "[material.display_name] [initial(name)]"
desc = "A set of earrings made from [material.display_name]."
color = material.icon_colour


/obj/item/clothing/ears/earring/silver
material = MATERIAL_SILVER

@@ -522,8 +522,7 @@
s.set_up(2, 1, location)
s.start()
for(var/mob/living/carbon/human/M in viewers(world.view, location))
var/obj/item/clothing/glasses/glasses = M.glasses
if(istype(glasses) && glasses.flash_protection >= FLASH_PROTECTION_MODERATE)
if(M.flash_protection < FLASH_PROTECTION_MODERATE)
switch(get_dist(M, location))
if(0 to 3)
M.flash_eyes()
@@ -15,6 +15,7 @@


/datum/unit_test/apc_area_test/start_test()

var/list/bad_areas = list()
var/area_test_count = 0

@@ -28,6 +29,8 @@
var/bad_msg = "--------------- [A.name]([A.type])"

var/exemptions = get_exemptions(A)
if(exemptions == -1)
exemptions = GLOB.using_map.default_apc_check_exemptions
if(!A.apc && !(exemptions & GLOB.using_map.NO_APC))
log_bad("[bad_msg] lacks an APC.")
area_good = 0
@@ -61,10 +64,12 @@

/datum/unit_test/apc_area_test/proc/get_exemptions(var/area)
// We assume deeper types come last
. = -1
for(var/i = GLOB.using_map.apc_test_exempt_areas.len; i>0; i--)
var/exempt_type = GLOB.using_map.apc_test_exempt_areas[i]
if(istype(area, exempt_type))
return GLOB.using_map.apc_test_exempt_areas[exempt_type]
. = GLOB.using_map.apc_test_exempt_areas[exempt_type]
break

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

@@ -1,5 +1,7 @@
/datum/map/cassini
default_apc_check_exemptions = NO_SCRUBBER|NO_VENT
apc_test_exempt_areas = list(
/area/cassini = 0,
/area/space = NO_SCRUBBER|NO_VENT|NO_APC,
/area/space/ocean = NO_SCRUBBER|NO_VENT|NO_APC
)
@@ -4,8 +4,10 @@
var/const/NO_SCRUBBER = 4

// Unit test vars
var/default_apc_check_exemptions = 0
var/list/apc_test_exempt_areas = list(
/area/exoplanet = NO_SCRUBBER|NO_VENT|NO_APC )
/area/exoplanet = NO_SCRUBBER|NO_VENT|NO_APC
)

var/list/area_coherency_test_exempt_areas = list(
/area/space,
@@ -31,11 +31,11 @@ exactly 12 "/obj text paths" '"/obj'
exactly 8 "/turf text paths" '"/turf'
exactly 1 "world<< uses" 'world<<|world[[:space:]]<<'
exactly 42 "world.log<< uses" 'world.log<<|world.log[[:space:]]<<'
exactly 496 "<< uses" '(?<!<)<<(?!<)' -P
exactly 499 "<< uses" '(?<!<)<<(?!<)' -P
exactly 0 "incorrect indentations" '^( {4,})' -P
exactly 25 "text2path uses" 'text2path'
exactly 1 "update_icon() override" '/update_icon\((.*)\)' -P
exactly 0 "goto uses" 'goto '
exactly 1 "goto uses" 'goto '
# With the potential exception of << if you increase any of these numbers you're probably doing it wrong

num=`find ./html/changelogs -not -name "*.yml" | wc -l`

0 comments on commit baba76b

Please sign in to comment.