Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-23-10-2025

This commit is contained in:
Roxy
2025-10-23 17:38:23 -04:00
453 changed files with 20635 additions and 15897 deletions
+1
View File
@@ -306,6 +306,7 @@
#include "stuns.dm"
#include "style_hotswapping.dm"
#include "subsystem_init.dm"
#include "suit_sensor.dm"
#include "suit_storage_icons.dm"
#include "surgeries.dm"
#include "syringe_gun.dm"
+10
View File
@@ -18,6 +18,16 @@
export_types = list(/obj/item/cargo_unit_test_content)
/datum/unit_test/cargo_selling/Run()
for(var/datum/export/subtype as anything in subtypesof(/datum/export))
if(subtype::abstract_type == subtype)
continue
if(subtype::k_recovery_time < SSprocessing.wait)
TEST_FAIL("[subtype] should have k_recovery time >= [SSprocessing.wait]")
var/datum/export/sell = new subtype
if(!length(sell.export_types))
TEST_FAIL("[subtype] has no export types")
qdel(sell)
var/obj/item/cargo_unit_test_container/box = allocate(/obj/item/cargo_unit_test_container)
var/obj/item/cargo_unit_test_container/box_skip_content = allocate(/obj/item/cargo_unit_test_container)
@@ -57,4 +57,4 @@
butcher.put_in_active_hand(gun, forced = TRUE)
click_wrapper(butcher, meat, list(RIGHT_CLICK = TRUE, BUTTON = RIGHT_CLICK))
TEST_ASSERT(DOING_INTERACTION(butcher, meat), "The butcher did not start butchering the monkey when using a bayonetted weapon.")
TEST_ASSERT(QDELETED(meat), "The butcher did not butchering the monkey when using a bayonetted weapon.")
@@ -30,7 +30,8 @@
continue
if (antag_flag in known_antag_flags)
TEST_FAIL("[ruleset] has a non-unique antag_flag [antag_flag] (used by [known_antag_flags[antag_flag]])!")
if(!(initial(ruleset.ruleset_flags) & RULESET_VARIATION))
TEST_FAIL("[ruleset] has a non-unique antag_flag [antag_flag] (used by [known_antag_flags[antag_flag]])!")
continue
known_antag_flags[antag_flag] = ruleset
@@ -48,6 +48,13 @@
/// Checks that the contents of the fish_counts list are also present in fish_table
/datum/unit_test/focus_only/fish_sources_tables
/**
* This will tell us if we forgot to properly set the stable population for any fish.
* Fish with a stable population of one or less need to have either the mateless or crossbreeder trait, or be compatible with
* other fish types with a higher stable population.
*/
/datum/unit_test/focus_only/fish_population
/// Checks that maploaded mobs with either the `atmos_requirements` or `body_temp_sensitive`
/datum/unit_test/focus_only/atmos_and_temp_requirements
@@ -27,14 +27,14 @@
click_wrapper(attacker, to_smack)
TEST_ASSERT_NOTEQUAL(to_smack.get_integrity(), to_smack.max_integrity, "The barricade should have taken damage a from a non-combat-mode click.")
/// Tests that common tool interactions are possible still, by attempting to open the panel of an air alarm.
/// Tests that common tool interactions are possible still, by attempting to open the panel of an techfab.
/datum/unit_test/machinery_tool_interaction
/datum/unit_test/machinery_tool_interaction/Run()
var/mob/living/carbon/human/consistent/attacker = EASY_ALLOCATE()
var/obj/item/screwdriver/screwdriver = EASY_ALLOCATE()
var/obj/machinery/airalarm/to_smack = EASY_ALLOCATE()
var/obj/machinery/rnd/production/to_smack = EASY_ALLOCATE()
attacker.put_in_active_hand(screwdriver, forced = TRUE)
click_wrapper(attacker, to_smack)
TEST_ASSERT_EQUAL(to_smack.get_integrity(), to_smack.max_integrity, "The air alarm took damage when interacted with a screwdriver.")
TEST_ASSERT(to_smack.panel_open, "The air alarm should have opened its panel after being interacted with a screwdriver.")
TEST_ASSERT_EQUAL(to_smack.get_integrity(), to_smack.max_integrity, "The techfab took damage when interacted with a screwdriver.")
TEST_ASSERT(to_smack.panel_open, "The techfab should have opened its panel after being interacted with a screwdriver.")
+1 -1
View File
@@ -49,7 +49,7 @@
for (var/outfit_type in outfits_to_check)
// Only make one human and keep undressing it because it's much faster
for (var/obj/item/I in H.get_equipped_items(INCLUDE_POCKETS))
for (var/obj/item/I in H.get_equipped_items(INCLUDE_POCKETS|INCLUDE_ABSTRACT))
qdel(I)
var/datum/outfit/outfit = new outfit_type
+1 -1
View File
@@ -67,7 +67,7 @@
// finally, screenshot test of taking jumpsuit (everything) off
// which should test that the autogen legs disappear (here to cover a bug in which it does not disappear)
dummy.delete_equipment()
TEST_ASSERT_EQUAL(length(dummy.get_equipped_items()), 0, "Dummy (Ashwalker) should have no equipment!")
TEST_ASSERT_EQUAL(length(dummy.get_equipped_items(INCLUDE_POCKETS|INCLUDE_HELD)), 0, "Dummy (Ashwalker) should have no equipment!")
finished_icon = icon(finished_icon)
finished_icon.Insert(getFlatIcon(dummy, no_anim = TRUE), dir = SOUTH, frame = 9)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 989 B

+43
View File
@@ -0,0 +1,43 @@
///Test that ensures that basic functions and interactions around suit sensors are working
/datum/unit_test/suit_sensor
/datum/unit_test/suit_sensor/Run()
var/mob/living/carbon/human/consistent/dummy = allocate(__IMPLIED_TYPE__)
var/obj/item/clothing/under/sensor_test/under = allocate(__IMPLIED_TYPE__)
dummy.equip_to_slot_or_del(under, ITEM_SLOT_ICLOTHING)
TEST_ASSERT(under.set_sensor_mode(SENSOR_LIVING), "couldn't set the suit sensor mode to '[GLOB.suit_sensor_mode_to_defines[SENSOR_LIVING + 1]]'")
TEST_ASSERT((dummy in GLOB.suit_sensors_list), "couldn't find the dummy in the GLOB.suit_sensors_list")
var/obj/item/wirecutters/cutter = allocate(__IMPLIED_TYPE__)
dummy.put_in_active_hand(cutter, forced = TRUE)
click_wrapper(dummy, under) //cut sensor
TEST_ASSERT_EQUAL(under.has_sensor, NO_SENSORS, "couldn't properly cut suit sensor from the jumpsuit")
var/obj/item/suit_sensor/sensor = dummy.is_holding_item_of_type(__IMPLIED_TYPE__)
TEST_ASSERT(sensor, "dummy isn't holding the cut sensor")
//we set it to sensor_living before, remember?
TEST_ASSERT_EQUAL(sensor.sensor_mode, SENSOR_LIVING, "cut sensor isn't set to '[GLOB.suit_sensor_mode_to_defines[SENSOR_LIVING + 1]]'")
TEST_ASSERT(sensor.set_mode(SENSOR_OFF), "couldn't set cut sensor's mode to '[GLOB.suit_sensor_mode_to_defines[SENSOR_OFF + 1]]'")
sensor.emp_act(EMP_HEAVY)
TEST_ASSERT(sensor.broken, "cut sensor wasn't broken by EMP")
dummy.dropItemToGround(cutter) //thank you for your service, wirecutters o7
var/obj/item/stack/cable_coil/thirty/coil = allocate(__IMPLIED_TYPE__)
dummy.put_in_active_hand(coil, forced = TRUE)
click_wrapper(dummy, sensor) //fix sensor
TEST_ASSERT(!sensor.broken, "cut sensor couldn't be fixed by cable coil")
dummy.swap_hand(dummy.get_held_index_of_item(sensor))
click_wrapper(dummy, under) //install sensor
TEST_ASSERT_EQUAL(under.has_sensor, HAS_SENSORS, "couldn't properly install suit sensor on the jumpsuit")
under.emp_act(EMP_HEAVY)
TEST_ASSERT_EQUAL(under.has_sensor, BROKEN_SENSORS, "the jumpsuit sensor wasn't broken by EMP")
dummy.swap_hand(dummy.get_held_index_of_item(coil))
click_wrapper(dummy, under) //fix sensor, again
TEST_ASSERT_EQUAL(under.has_sensor, HAS_SENSORS, "couldn't fix the jumpsuit sensor with cable coil")
/obj/item/clothing/under/sensor_test
random_sensor = FALSE
+1 -1
View File
@@ -68,7 +68,7 @@
TEST_ASSERT_EQUAL(alice.facial_hair_color, COLOR_LIGHT_BROWN, "Bob's head was transplanted onto Alice's body, but their facial hair color is not COLOR_LIGHT_BROWN")
/datum/unit_test/multiple_surgeries/Run()
var/mob/living/carbon/human/user = allocate(/mob/living/carbon/human/consistent)
var/mob/living/carbon/human/user = allocate(/mob/living/carbon/human/consistent/slow)
var/mob/living/carbon/human/patient_zero = allocate(/mob/living/carbon/human/consistent)
var/mob/living/carbon/human/patient_one = allocate(/mob/living/carbon/human/consistent)
+2 -2
View File
@@ -44,5 +44,5 @@
continue
if(trash in food_trash_blacklist)
continue
TEST_ASSERT(food_trash[trash], "[food] must include its trash_type for loot table /obj/effect/spawner/random/trash/food_packaging or be added to this unit tests food_trash_blacklist")
if(!food_trash[trash])
TEST_FAIL("[food] must include its trash_type for loot table /obj/effect/spawner/random/trash/food_packaging or be added to this unit tests food_trash_blacklist")