Permalink
Browse files

Fix regression about percent extrusion width not being validated. Inc…

…ludes regression test
  • Loading branch information...
1 parent 8331c54 commit 4c650a6d8018d8ca42d6f0145bf40b443a2f1c9f @alexrj committed Feb 13, 2014
Showing with 10 additions and 2 deletions.
  1. +3 −1 lib/Slic3r/Config.pm
  2. +7 −1 t/config.t
View
@@ -325,7 +325,7 @@ sub validate {
my $max_nozzle_diameter = max(@{ $self->nozzle_diameter });
die "Invalid extrusion width (too large)\n"
if defined first { $_ > 10 * $max_nozzle_diameter }
- map $self->get_value("${_}_extrusion_width"),
+ map $self->get_abs_value_over("${_}_extrusion_width", $self->layer_height),
qw(perimeter infill solid_infill top_infill support_material first_layer);
}
@@ -355,6 +355,8 @@ sub validate {
}
}
}
+
+ return 1;
}
sub replace_options {
View
@@ -1,4 +1,4 @@
-use Test::More tests => 1;
+use Test::More tests => 2;
use strict;
use warnings;
@@ -17,4 +17,10 @@ use Slic3r::Test;
is $ENV{SLIC3R_LAYER_HEIGHT}, '0.123', 'setenv';
}
+{
+ my $config = Slic3r::Config->new_from_defaults;
+ $config->set('perimeter_extrusion_width', '250%');
+ ok $config->validate, 'percent extrusion width is validated';
+}
+
__END__

0 comments on commit 4c650a6

Please sign in to comment.