diff --git a/code/modules/unit_tests/gun_sanity.dm b/code/modules/unit_tests/gun_sanity.dm index 4311612ad908..a3834b60b4af 100644 --- a/code/modules/unit_tests/gun_sanity.dm +++ b/code/modules/unit_tests/gun_sanity.dm @@ -3,9 +3,15 @@ var/obj/item/gun/target_gun = new gun_path() log_test("Testing [target_gun.type]") if(target_gun.default_ammo_type) - TEST_ASSERT(ispath(target_gun.default_ammo_type), "The default ammo in [target_gun.type] is not a type") - TEST_ASSERT(target_gun.default_ammo_type in target_gun.allowed_ammo_types, "The default ammo in [target_gun.type] in not in its allowed ammo types") - TEST_ASSERT_EQUAL(target_gun.magazine?.type, target_gun.default_ammo_type, "[target_gun.type]'s mag does not equal its default_ammo_type") + if(ispath(target_gun.default_ammo_type)) + TEST_FAIL("The default ammo in [target_gun.type] is not a type") + + if(!(target_gun.default_ammo_type in target_gun.allowed_ammo_types)) + TEST_FAIL("The default ammo in [target_gun.type] in not in its allowed ammo types") + + if(!(target_gun.magazine?.type == target_gun.default_ammo_type)) + TEST_FAIL("[target_gun.type]'s mag does not equal its default_ammo_type") else - TEST_ASSERT(!target_gun.internal_magazine, "A gun with an internal mag has no mag") + if(target_gun.internal_magazine) + TEST_FAIL("[target_gun.type] with an internal mag has no mag") qdel(target_gun)