diff options
author | bubnikv <bubnikv@gmail.com> | 2020-02-09 11:43:15 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-02-09 11:43:15 +0300 |
commit | e7d2fcf0be7a524eb8bf40dd2964539534934e96 (patch) | |
tree | f90c96c4859a2371b41a51f045997793108988bf /t | |
parent | 76433da64c24c5aa73ac247bf963fef9c313dadf (diff) |
Fixed unit tests broken with the previous commit (Spiral Vase fix).
Fixed a crash in the previous commit.
Diffstat (limited to 't')
-rw-r--r-- | t/gcode.t | 36 | ||||
-rw-r--r-- | t/shells.t | 56 |
2 files changed, 48 insertions, 44 deletions
@@ -1,4 +1,4 @@ -use Test::More tests => 25; +use Test::More tests => 24; use strict; use warnings; @@ -199,22 +199,24 @@ use Slic3r::Test; like $gcode, qr/START:20mm_cube/, '[input_filename] is also available in custom G-code'; } -{ - my $config = Slic3r::Config::new_from_defaults; - $config->set('spiral_vase', 1); - my $print = Slic3r::Test::init_print('cube_with_hole', config => $config); - - my $spiral = 0; - Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { - my ($self, $cmd, $args, $info) = @_; - - if ($cmd eq 'G1' && exists $args->{E} && exists $args->{Z}) { - $spiral = 1; - } - }); - - ok !$spiral, 'spiral vase is correctly disabled on layers with multiple loops'; -} +# The current Spiral Vase slicing code removes the holes and all but the largest contours from each slice, +# therefore the following test is no more valid. +#{ +# my $config = Slic3r::Config::new_from_defaults; +# $config->set('spiral_vase', 1); +# my $print = Slic3r::Test::init_print('cube_with_hole', config => $config); +# +# my $spiral = 0; +# Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { +# my ($self, $cmd, $args, $info) = @_; +# +# if ($cmd eq 'G1' && exists $args->{E} && exists $args->{Z}) { +# $spiral = 1; +# } +# }); +# +# ok !$spiral, 'spiral vase is correctly disabled on layers with multiple loops'; +#} { diff --git a/t/shells.t b/t/shells.t index dc38ff4aa..c40131590 100644 --- a/t/shells.t +++ b/t/shells.t @@ -1,4 +1,4 @@ -use Test::More tests => 21; +use Test::More tests => 20; use strict; use warnings; @@ -293,31 +293,33 @@ use Slic3r::Test; ok !$horizontal_extrusions, 'no horizontal extrusions'; } -{ - my $config = Slic3r::Config::new_from_defaults; - $config->set('perimeters', 1); - $config->set('fill_density', 0); - $config->set('top_solid_layers', 0); - $config->set('spiral_vase', 1); - $config->set('bottom_solid_layers', 0); - $config->set('skirts', 0); - $config->set('first_layer_height', '100%'); - $config->set('start_gcode', ''); - - my $print = Slic3r::Test::init_print('two_hollow_squares', config => $config); - my $diagonal_moves = 0; - Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { - my ($self, $cmd, $args, $info) = @_; - - if ($cmd eq 'G1') { - if ($info->{extruding} && $info->{dist_XY} > 0) { - if ($info->{dist_Z} > 0) { - $diagonal_moves++; - } - } - } - }); - is $diagonal_moves, 0, 'no spiral moves on two-island object'; -} +# The current Spiral Vase slicing code removes the holes and all but the largest contours from each slice, +# therefore the following test is no more valid. +#{ +# my $config = Slic3r::Config::new_from_defaults; +# $config->set('perimeters', 1); +# $config->set('fill_density', 0); +# $config->set('top_solid_layers', 0); +# $config->set('spiral_vase', 1); +# $config->set('bottom_solid_layers', 0); +# $config->set('skirts', 0); +# $config->set('first_layer_height', '100%'); +# $config->set('start_gcode', ''); +# +# my $print = Slic3r::Test::init_print('two_hollow_squares', config => $config); +# my $diagonal_moves = 0; +# Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { +# my ($self, $cmd, $args, $info) = @_; +# +# if ($cmd eq 'G1') { +# if ($info->{extruding} && $info->{dist_XY} > 0) { +# if ($info->{dist_Z} > 0) { +# $diagonal_moves++; +# } +# } +# } +# }); +# is $diagonal_moves, 0, 'no spiral moves on two-island object'; +#} __END__ |