Tweak thresholds.

MozReview-Commit-ID: GMd1Huv8N5s
This commit is contained in:
Bobby Holley 2017-03-14 21:55:47 -07:00
parent 6a2a5be764
commit 418f829183

View file

@ -16,7 +16,7 @@ fn size_of_property_declaration() {
} else if new > old { } else if new > old {
panic!("Your changes have increased the stack size of PropertyDeclaration enum from {} to {}. \ panic!("Your changes have increased the stack size of PropertyDeclaration enum from {} to {}. \
These enum is present in large quantities in the style, and increasing the size \ These enum is present in large quantities in the style, and increasing the size \
may dramatically affect our memory footprint. Please consider using `boxed=\"True\"` in \ may negatively affect style system performance. Please consider using `boxed=\"True\"` in \
the longhand If you feel that the increase is necessary, update to the new size in \ the longhand If you feel that the increase is necessary, update to the new size in \
tests/unit/style/size_of.rs.", tests/unit/style/size_of.rs.",
old, new) old, new)
@ -25,20 +25,20 @@ fn size_of_property_declaration() {
#[test] #[test]
fn size_of_specified_values() { fn size_of_specified_values() {
let threshold = 40; let threshold = 32;
let longhands = specified_value_sizes(); let longhands = specified_value_sizes();
let mut failing_messages = vec![]; let mut failing_messages = vec![];
for specified_value in longhands { for specified_value in longhands {
if specified_value.1 >= threshold && !specified_value.2 { if specified_value.1 > threshold && !specified_value.2 {
failing_messages.push( failing_messages.push(
format!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \ format!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \
currently {}. SpecifiedValues are affect size of PropertyDeclaration enum and \ currently {}. SpecifiedValues affect size of PropertyDeclaration enum and \
increasing the size may dramatically affect our memory footprint. Please consider \ increasing the size may negative affect style system performance. Please consider \
using `boxed=\"True\"` in this longhand.", using `boxed=\"True\"` in this longhand.",
specified_value.0, specified_value.1, threshold)); specified_value.0, specified_value.1, threshold));
} else if specified_value.1 < threshold && specified_value.2 { } else if specified_value.1 <= threshold && specified_value.2 {
failing_messages.push( failing_messages.push(
format!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \ format!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \
The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.", The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.",