From e48cccf4534a827ca0eb666f75947ac9066d4227 Mon Sep 17 00:00:00 2001 From: drhead <1313496+drhead@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:32:51 -0400 Subject: [PATCH] Density sanity check (#54747) * Partial framework for density sanity check * Changed materials.json density to float, updated values * Fixed json errors and initial test complete * attempt to show item name Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Co-authored-by: Binrui Dong --- data/json/materials.json | 179 +++++++++++++++++++++------------------ src/material.cpp | 2 +- src/material.h | 4 +- tests/item_test.cpp | 28 ++++++ 4 files changed, 129 insertions(+), 84 deletions(-) diff --git a/data/json/materials.json b/data/json/materials.json index 87c6aafea6199..e7cf7372f5dc8 100644 --- a/data/json/materials.json +++ b/data/json/materials.json @@ -5,7 +5,7 @@ "name": "Polymer Resin", "specific_heat_liquid": 1.25, "specific_heat_solid": 1.25, - "density": 1, + "density": 1.0, "latent_heat": 18, "bash_resist": 4, "cut_resist": 6, @@ -108,7 +108,7 @@ "type": "material", "id": "alcohol", "name": "Alcohol", - "density": 1, + "density": 1.0, "specific_heat_liquid": 4, "specific_heat_solid": 2, "latent_heat": 310, @@ -160,7 +160,7 @@ "type": "material", "id": "alien_resin", "name": "Resin", - "density": 10, + "density": 1.5, "specific_heat_liquid": 1.8, "specific_heat_solid": 1.8, "latent_heat": 50, @@ -182,7 +182,7 @@ "type": "material", "id": "aluminum", "name": "Aluminum", - "density": 10, + "density": 2.7, "specific_heat_liquid": 1.18, "specific_heat_solid": 0.91, "latent_heat": 398, @@ -202,7 +202,7 @@ "type": "material", "id": "acidchitin", "name": "Biosilicified Chitin", - "density": 17, + "density": 4.5, "specific_heat_liquid": 4.186, "specific_heat_solid": 2.108, "latent_heat": 333, @@ -227,7 +227,7 @@ "type": "material", "id": "bone", "name": "Bone", - "density": 7, + "density": 1.4, "specific_heat_liquid": 1.2, "specific_heat_solid": 1.2, "latent_heat": 200, @@ -257,7 +257,8 @@ "type": "material", "id": "brass", "name": "Brass", - "density": 30, + "//": "Density value assumes median bronze alloy weight", + "density": 8.8, "specific_heat_liquid": 0.49, "specific_heat_solid": 0.39, "latent_heat": 205, @@ -276,7 +277,7 @@ "type": "material", "id": "bronze", "name": "Bronze", - "density": 58, + "density": 8.8, "bash_resist": 4, "cut_resist": 5, "bullet_resist": 2, @@ -313,7 +314,7 @@ "type": "material", "id": "fancy_bronze", "name": "Thessalonian Bronze", - "density": 58, + "density": 8.8, "bash_resist": 5, "cut_resist": 5, "bullet_resist": 2, @@ -331,7 +332,7 @@ "type": "material", "id": "budget_steel", "name": "Budget Steel", - "density": 30, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -375,7 +376,8 @@ "type": "material", "id": "ceramic", "name": "Ceramic", - "density": 8, + "//": "Density value assumes Titanium Diboride", + "density": 4.5, "specific_heat_liquid": 1, "specific_heat_solid": 1, "latent_heat": 333, @@ -447,7 +449,7 @@ "type": "material", "id": "lightceramic", "name": "Dragon Scale", - "density": 4, + "density": 4.5, "bash_resist": 4, "cut_resist": 8, "bullet_resist": 6, @@ -463,7 +465,7 @@ "type": "material", "id": "chitin", "name": "Chitin", - "density": 10, + "density": 1.45, "specific_heat_liquid": 4.186, "specific_heat_solid": 2.108, "latent_heat": 333, @@ -490,7 +492,7 @@ "type": "material", "id": "clay", "name": "Clay", - "density": 8, + "density": 1.6, "specific_heat_liquid": 1, "specific_heat_solid": 1, "latent_heat": 333, @@ -510,7 +512,7 @@ "type": "material", "id": "copper", "name": "Copper", - "density": 59, + "density": 9.0, "specific_heat_liquid": 0.49, "specific_heat_solid": 0.39, "latent_heat": 205, @@ -531,7 +533,7 @@ "type": "material", "id": "cotton", "name": "Cotton", - "density": 3, + "density": 1.6, "specific_heat_liquid": 0.02, "specific_heat_solid": 0.02, "latent_heat": 205, @@ -561,7 +563,7 @@ "type": "material", "id": "diamond", "name": "Diamond", - "density": 14, + "density": 3.53, "specific_heat_liquid": 0.52, "specific_heat_solid": 0.52, "latent_heat": 5200, @@ -580,7 +582,8 @@ "type": "material", "id": "gemstone", "name": "Gemstone", - "density": 14, + "//": "Density of Zircon", + "density": 4.7, "specific_heat_liquid": 0.52, "specific_heat_solid": 0.52, "latent_heat": 5200, @@ -599,7 +602,7 @@ "type": "material", "id": "egg", "name": "Egg", - "density": 3, + "density": 1.1, "specific_heat_liquid": 3.63, "specific_heat_solid": 1.95, "latent_heat": 252, @@ -621,7 +624,8 @@ "type": "material", "id": "flesh", "name": "Flesh", - "density": 5, + "//": "Density of non-fat parts of human body, also around upper-level densities for all organic matter", + "density": 1.1, "specific_heat_liquid": 3.7, "specific_heat_solid": 2.15, "latent_heat": 260, @@ -648,7 +652,7 @@ "type": "material", "id": "gutskin", "name": "Gutskin", - "density": 5, + "density": 1.1, "specific_heat_liquid": 3.7, "specific_heat_solid": 2.15, "latent_heat": 260, @@ -674,7 +678,7 @@ "type": "material", "id": "freshclay", "name": "Fresh Clay", - "density": 4, + "density": 1.76, "specific_heat_liquid": 4.186, "specific_heat_solid": 2.108, "latent_heat": 333, @@ -694,7 +698,7 @@ "type": "material", "id": "fruit", "name": "Fruit Matter", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -721,7 +725,7 @@ "type": "material", "id": "fur", "name": "Fur", - "density": 9, + "density": 1.1, "specific_heat_liquid": 0.02, "specific_heat_solid": 0.02, "latent_heat": 333, @@ -749,7 +753,7 @@ "type": "material", "id": "faux_fur", "name": "Faux Fur", - "density": 8, + "density": 1.1, "specific_heat_liquid": 0.02, "specific_heat_solid": 0.02, "latent_heat": 333, @@ -777,8 +781,8 @@ "type": "material", "id": "lvl4ballisticglass", "name": "Ballistic Glass", - "//": "Values are based on thickness being a quarter of an inch.", - "density": 30, + "//": "Values are based on glass-clad polycarbonate.", + "density": 2.0, "specific_heat_liquid": 0.2, "specific_heat_solid": 0.2, "latent_heat": 100, @@ -803,7 +807,8 @@ "type": "material", "id": "glass", "name": "Glass", - "density": 14, + "//": "Density based on soda lime silica glass", + "density": 2.5, "specific_heat_liquid": 0.2, "specific_heat_solid": 0.2, "latent_heat": 100, @@ -828,7 +833,7 @@ "type": "material", "id": "gold", "name": "Gold", - "density": 130, + "density": 19.3, "specific_heat_liquid": 0.15, "specific_heat_solid": 0.13, "latent_heat": 63, @@ -849,7 +854,7 @@ "type": "material", "id": "hflesh", "name": "Human Flesh", - "density": 5, + "density": 1.1, "specific_heat_liquid": 3.7, "specific_heat_solid": 2.15, "latent_heat": 260, @@ -876,7 +881,7 @@ "type": "material", "id": "honey", "name": "Honey", - "density": 1, + "density": 1.45, "specific_heat_liquid": 2.03, "specific_heat_solid": 2.03, "latent_heat": 57, @@ -899,7 +904,8 @@ "type": "material", "id": "hydrocarbons", "name": "Hydrocarbons", - "density": 1, + "//": "Oxyacetylene is the only user, stats based on Acetylene", + "density": 0.7, "specific_heat_liquid": 0.5, "specific_heat_solid": 0.5, "latent_heat": 518, @@ -923,6 +929,7 @@ "type": "material", "id": "diesel", "name": "Diesel", + "density": 0.85, "copy-from": "hydrocarbons", "fuel_data": { "energy": 35.8, @@ -934,6 +941,7 @@ "type": "material", "id": "jp8", "name": "JP8", + "density": 0.84, "copy-from": "hydrocarbons", "fuel_data": { "energy": 34.7, @@ -944,6 +952,7 @@ { "type": "material", "id": "avgas", + "density": 0.69, "name": "Avgas Fuel", "copy-from": "hydrocarbons", "fuel_data": { @@ -956,6 +965,7 @@ "type": "material", "id": "biodiesel", "name": "Biodiesel", + "density": 0.875, "copy-from": "hydrocarbons", "fuel_data": { "energy": 29.6, @@ -966,6 +976,7 @@ "type": "material", "id": "gasoline", "name": "Gasoline", + "density": 0.75, "copy-from": "hydrocarbons", "fuel_data": { "energy": 34.2, @@ -976,6 +987,7 @@ { "type": "material", "id": "lamp_oil", + "density": 0.81, "name": "Lamp Oil", "copy-from": "hydrocarbons", "fuel_data": { @@ -987,6 +999,7 @@ { "type": "material", "id": "motor_oil", + "density": 0.95, "name": "Motor Oil", "copy-from": "hydrocarbons", "fuel_data": { @@ -999,7 +1012,7 @@ "type": "material", "id": "iflesh", "name": "Insect Flesh", - "density": 5, + "density": 1.1, "specific_heat_liquid": 3.7, "specific_heat_solid": 2.15, "latent_heat": 260, @@ -1026,7 +1039,7 @@ "type": "material", "id": "iron", "name": "Iron", - "density": 52, + "density": 8, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1047,7 +1060,7 @@ "type": "material", "id": "junk", "name": "Junk Food", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.3, "specific_heat_solid": 2.05, "latent_heat": 220, @@ -1075,7 +1088,7 @@ "type": "material", "id": "kevlar", "name": "Kevlar", - "density": 9, + "density": 1.4, "soft": true, "reinforces": true, "specific_heat_liquid": 0.82, @@ -1099,7 +1112,7 @@ "type": "material", "id": "kevlar_layered", "name": "Layered Kevlar", - "density": 10, + "density": 1.4, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1123,7 +1136,7 @@ "type": "material", "id": "kevlar_rigid", "name": "Rigid Kevlar", - "density": 10, + "density": 1.4, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1144,7 +1157,7 @@ "type": "material", "id": "lead", "name": "Lead", - "density": 100, + "density": 11.3, "specific_heat_liquid": 0.13, "specific_heat_solid": 0.14, "latent_heat": 2, @@ -1165,7 +1178,7 @@ "type": "material", "id": "leather", "name": "Leather", - "density": 6, + "density": 1.1, "specific_heat_liquid": 1.5, "specific_heat_solid": 1.5, "latent_heat": 273, @@ -1196,7 +1209,7 @@ "id": "lycra", "name": "Lycra", "//": "not actually pure Lycra, but poly/nylon and Lycra blend", - "density": 2, + "density": 1.2, "specific_heat_liquid": 1.7, "specific_heat_solid": 1.7, "latent_heat": 27, @@ -1225,7 +1238,7 @@ "type": "material", "id": "milk", "name": "Dairy", - "density": 1, + "density": 1.1, "specific_heat_liquid": 3.89, "specific_heat_solid": 1.81, "latent_heat": 293, @@ -1252,7 +1265,7 @@ "type": "material", "id": "neoprene", "name": "Neoprene", - "density": 4, + "density": 1.25, "breathability": "POOR", "specific_heat_liquid": 1.1, "specific_heat_solid": 1.1, @@ -1280,7 +1293,7 @@ "type": "material", "id": "nomex", "name": "Nomex", - "density": 4, + "density": 1.05, "specific_heat_liquid": 1.2, "specific_heat_solid": 1.2, "latent_heat": 273, @@ -1325,7 +1338,7 @@ "type": "material", "id": "oil", "name": "Oil", - "density": 1, + "density": 1.0, "specific_heat_liquid": 2, "specific_heat_solid": 1.8, "latent_heat": 200, @@ -1350,7 +1363,7 @@ "type": "material", "id": "beeswax", "name": "Beeswax", - "density": 1, + "density": 1.0, "//": "https://www.tainstruments.com/pdf/literature/TA405.pdf", "specific_heat_liquid": 2.9, "specific_heat_solid": 3.7, @@ -1377,7 +1390,7 @@ "type": "material", "id": "paper", "name": "Paper", - "density": 4, + "density": 1.2, "specific_heat_liquid": 1.34, "specific_heat_solid": 1.34, "latent_heat": 333, @@ -1401,7 +1414,7 @@ "type": "material", "id": "dry_plant", "name": "Dry Plant", - "density": 4, + "density": 1.2, "specific_heat_liquid": 1.34, "specific_heat_solid": 1.34, "latent_heat": 333, @@ -1422,7 +1435,8 @@ "type": "material", "id": "plastic", "name": "Plastic", - "density": 8, + "//": "Most common plastics are around 1", + "density": 1.0, "specific_heat_liquid": 1.6, "specific_heat_solid": 1.6, "latent_heat": 50, @@ -1515,7 +1529,7 @@ "type": "material", "id": "silver", "name": "Silver", - "density": 70, + "density": 10.5, "specific_heat_liquid": 0.28, "specific_heat_solid": 0.23, "latent_heat": 111, @@ -1536,7 +1550,7 @@ "type": "material", "id": "platinum", "name": "Platinum", - "density": 140, + "density": 21.5, "specific_heat_liquid": 0.18, "specific_heat_solid": 0.13, "latent_heat": 100, @@ -1558,7 +1572,7 @@ "id": "rubber", "name": "Rubber", "//1": "this is sythetic rubber, which is much different than natural, but called rubber for ease of use", - "density": 10, + "density": 1.6, "soft": false, "specific_heat_liquid": 0.4, "specific_heat_solid": 0.13, @@ -1603,7 +1617,7 @@ "id": "lc_steel", "name": "Low Carbon Steel", "//": "SAE 1010/UNS 10100, assumes .1% carbon content and zero slag.", - "density": 8, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1625,7 +1639,7 @@ "id": "mc_steel", "name": "Medium Carbon Steel", "//": "SAE 1050/UNS 10500, assumes .50% carbon content and zero slag.", - "density": 8, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1647,7 +1661,7 @@ "id": "hc_steel", "name": "High Carbon Steel", "//": "SAE 1085/UNS 10850, assumes .50% carbon content and zero slag.", - "density": 8, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1669,7 +1683,7 @@ "id": "ch_steel", "name": "Case Hardened Carbon Steel", "//": "Case hardening based on average between .1 and .95 carbon steel with a 1.25 multiplier.", - "density": 8, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1691,7 +1705,7 @@ "id": "qt_steel", "name": "Tempered Carbon Steel", "//": "Quench/tempering based on .6 carbon steel with a 1.5 multiplier.", - "density": 8, + "density": 8.0, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1876,7 +1890,7 @@ "type": "material", "id": "plut_cell", "name": "Energetic Nanocompound", - "density": 30, + "density": 20.0, "bash_resist": 6, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, @@ -1923,7 +1937,8 @@ "type": "material", "id": "stone", "name": "Stone", - "density": 17, + "//": "Density based on granite", + "density": 2.8, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1963,7 +1978,8 @@ "type": "material", "id": "superalloy", "name": "Superalloy", - "density": 26, + "//": "Density based on superalloy sheet", + "density": 1.8, "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, "latent_heat": 273, @@ -1983,8 +1999,9 @@ { "type": "material", "id": "carbide", + "//": "Based on tungsten carbide", + "density": 16.0, "name": "Layered Carbide", - "density": 30, "breathability": "SECOND_SKIN", "specific_heat_liquid": 0.82, "specific_heat_solid": 0.45, @@ -2005,7 +2022,7 @@ "id": "nylon", "name": "Synthetic Fabric", "//": "blend between nylon 6 and 6,6", - "density": 2, + "density": 1.15, "specific_heat_liquid": 1.7, "specific_heat_solid": 1.7, "latent_heat": 42, @@ -2055,7 +2072,7 @@ "id": "tin", "name": "Tin", "//": "Tin's density is a little more than half that of silver.", - "density": 50, + "density": 5.8, "//2": "Specific heat of liquid: https://www.engineeringtoolbox.com/liquid-metal-boiling-points-specific-heat-d_1893.html", "specific_heat_liquid": 0.24, "//3": "Specific heat as solid from http://www2.ucdsb.on.ca/tiss/stretton/database/Specific_Heat_Capacity_Table.html", @@ -2080,7 +2097,7 @@ "type": "material", "id": "veggy", "name": "Vegetable Matter", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -2107,7 +2124,7 @@ "type": "material", "id": "tomato", "name": "Tomato", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -2134,7 +2151,7 @@ "type": "material", "id": "bean", "name": "Bean", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -2161,7 +2178,7 @@ "type": "material", "id": "garlic", "name": "Garlic", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -2188,7 +2205,7 @@ "type": "material", "id": "nut", "name": "Nut", - "density": 5, + "density": 1.1, "specific_heat_liquid": 2.2, "specific_heat_solid": 2.2, "latent_heat": 20, @@ -2215,7 +2232,7 @@ "type": "material", "id": "mushroom", "name": "Mushroom", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3.9, "specific_heat_solid": 1.9, "latent_heat": 290, @@ -2242,7 +2259,7 @@ "type": "material", "id": "water", "name": "Water", - "density": 1, + "density": 1.0, "specific_heat_liquid": 4.186, "specific_heat_solid": 2.108, "latent_heat": 333, @@ -2280,7 +2297,7 @@ "type": "material", "id": "wheat", "name": "Wheat", - "density": 4, + "density": 1.1, "specific_heat_liquid": 2, "specific_heat_solid": 2, "latent_heat": 150, @@ -2303,7 +2320,7 @@ "type": "material", "id": "wood", "name": "Wood", - "density": 4, + "density": 1.26, "specific_heat_liquid": 1.7, "specific_heat_solid": 1.7, "latent_heat": 273, @@ -2345,7 +2362,7 @@ "type": "material", "id": "wool", "name": "Wool", - "density": 9, + "density": 1.4, "specific_heat_liquid": 0.02, "specific_heat_solid": 0.02, "latent_heat": 273, @@ -2375,7 +2392,7 @@ "type": "material", "id": "feces", "name": "Feces", - "density": 4, + "density": 1.1, "specific_heat_liquid": 1.7, "specific_heat_solid": 1.7, "latent_heat": 273, @@ -2399,7 +2416,7 @@ "type": "material", "id": "dried_vegetable", "name": "Dried Vegetable", - "density": 4, + "density": 1.1, "specific_heat_liquid": 2.5, "specific_heat_solid": 3.5, "latent_heat": 100, @@ -2426,7 +2443,7 @@ "type": "material", "id": "cured_meat", "name": "Cured Meat", - "density": 5, + "density": 1.1, "specific_heat_liquid": 3.16, "specific_heat_solid": 2.31, "latent_heat": 190, @@ -2453,7 +2470,7 @@ "type": "material", "id": "processed_food", "name": "Processed Food", - "density": 4, + "density": 1.1, "specific_heat_liquid": 3, "specific_heat_solid": 2, "latent_heat": 190, @@ -2475,7 +2492,7 @@ "type": "material", "id": "cheese", "name": "Cheese", - "density": 1, + "density": 1.1, "specific_heat_liquid": 3, "specific_heat_solid": 2.7, "latent_heat": 160, @@ -2502,7 +2519,7 @@ "type": "material", "id": "ice_cream", "name": "Ice Cream", - "density": 1, + "density": 1.1, "specific_heat_liquid": 3.15, "specific_heat_solid": 2.74, "latent_heat": 200, @@ -2528,7 +2545,7 @@ "type": "material", "id": "soil", "name": "Soil", - "density": 4, + "density": 1.5, "specific_heat_liquid": 1.7, "specific_heat_solid": 1.7, "latent_heat": 273, @@ -2548,7 +2565,7 @@ "type": "material", "id": "zinc", "name": "Zinc", - "density": 10, + "density": 7.2, "specific_heat_liquid": 1.18, "specific_heat_solid": 0.91, "latent_heat": 260, diff --git a/src/material.cpp b/src/material.cpp index 230a6955bba7c..3e1742b2eeb5d 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -252,7 +252,7 @@ float material_type::freeze_point() const return _freeze_point; } -int material_type::density() const +float material_type::density() const { return _density; } diff --git a/src/material.h b/src/material.h index a29618c73675f..e4821aaff5408 100644 --- a/src/material.h +++ b/src/material.h @@ -86,7 +86,7 @@ class material_type float _fire_resist = 0.0f; float _bullet_resist = 0.0f; int _chip_resist = 0; // Resistance to physical damage of the item itself - int _density = 1; // relative to "powder", which is 1 + float _density = 1; // relative to "powder", which is 1 // ability of a fabric to allow moisture vapor to be transmitted through the material breathability_rating _breathability = breathability_rating::IMPERMEABLE; // How resistant this material is to wind as a percentage - 0 to 100 @@ -147,7 +147,7 @@ class material_type float specific_heat_solid() const; float latent_heat() const; float freeze_point() const; - int density() const; + float density() const; bool is_valid_thickness( float thickness ) const; float thickness_multiple() const; diff --git a/tests/item_test.cpp b/tests/item_test.cpp index 4fdcdac246b80..d7d96d18c7569 100644 --- a/tests/item_test.cpp +++ b/tests/item_test.cpp @@ -700,3 +700,31 @@ TEST_CASE( "water affect items while swimming check", "[item][water][swimming]" } } } + +static void assert_maximum_density_for_material( const item &target ) +{ + if( to_milliliter( target.volume() ) == 0 ) { + return; + } + const std::map mats = target.made_of(); + if( !mats.empty() ) { + + double item_density = static_cast( to_gram( target.weight() ) ) / static_cast + ( to_milliliter( target.volume() ) ); + double max_density = 0; + for( const auto &m : mats ) { + // this test will NOT pass right now so for now check but allow failing + max_density += m.first.obj().density() * m.second / target.type->mat_portion_total; + } + INFO( target.type_name() ); + CHECK( item_density <= max_density ); + } +} + +TEST_CASE( "item_material_density_sanity_check", "[item][!mayfail]" ) +{ + for( const itype *type : item_controller->all() ) { + const item sample( type, calendar::turn_zero, item::solitary_tag{} ); + assert_maximum_density_for_material( sample ); + } +}